0

I need an advice regarding parsing a blob field from sqlite db. The field's content is a polygon information which I suppose is something like array of arrays.

I started like this:

NSData * theData = [[NSData alloc]initWithBytes:sqlite3_column_blob(statement, 0) length:sqlite3_column_bytes(statement,0)];

which gives me some like (this is just a part):

<01030000 00010000 00930100 0099d711 876c4031 40514cde 00330348 409f0436 e7e03d31 40a7b052 41450348 40fb230c 03963c31 402b14e9 7e4e0348 407e1821 3cda3031 407e1ea3 3cf30248 40fd1186 014b2e31 40fd4ae7>

Not much sure how to continue now. Any help will be appreciated.

Vanya
  • 4,973
  • 5
  • 32
  • 57
  • Hardly anything to help with, if you don't know the storage format. A geographical polygon is most frequently an array of tuples (latitude/longitude). But is it floats? Doubles? Microdegree integers? Or even something legacy like Gauss Krueger? What is the source of your db? – Pavel Zdenek Sep 14 '12 at 12:50
  • @PavelZdenek Hi Pavel, I took shape file from this site http://thematicmapping.org/downloads/world_borders.php and then converted into the sqlite file. – Vanya Sep 17 '12 at 06:46

1 Answers1

1

The mapping package you downloaded is in this format

http://en.wikipedia.org/wiki/Shapefile

Hence you could be interested in some existing code for parsing it. Converting to sqlite won't help you in any way.

Shapefile with ObjectiveC

https://github.com/grgcombs/iOS-Shapefile

Community
  • 1
  • 1
Pavel Zdenek
  • 7,146
  • 1
  • 23
  • 38