3

I am new to the decoding world (and even to the world of gis), but I am definitely not new to programming and large data. I was tasked with uncovering a column in our db with this information. It's probably some sort of geolocation w/ attributes... can anybody help?

The application is based in .net and the way we get this file (which i think is hexadecimal) is by ingesting a bunch of shp files, then storing them in an azure db. Currently, the only way to read this blob is one manual click at a time down a huge hierarchy of subsets.

I went to

https://hexed.it/?hl=en

and pasted the code and it translated (binary/text) until line 000064A0

Even when it was translated, it just turned to random numbers...

I also asked for help on reddit. reddit.com/r/codes/comments/421xek/can_somebody_help_me_decode_this_blob/

Here's the file: https://www.dropbox.com/s/om7xjuoztafm17e/Blob.txt?dl=0

The end goal is to build a python program to read this blob. Once I understand how to translate it, I can take it from there!

  • Determining how the geometry is being stored in your BLOBs will help you out greatly. It doesn't look like WKB, nor it is an entire shapefile. You say you are 'ingesting a bunch of files, then storing them in an azure db.' How is the BLOB generated in the first place? – Evil Genius Jan 25 '16 at 15:19
  • There are an infinite number of potential formats. You have this tagged with "esri-geodatabase" -- Is the data stored in an enterprise geodatabase? If so, what storage format was used? The database natively supports two formats which don't need to be decoded. One of these is certainly the format which should be used, which would obviate the need to decode an only partially documented SDEBINARY. – Vince Jan 25 '16 at 15:22
  • @EvilGenius like this? POINT(-85.16601269797088,38.295447785748429) sorry, I am new to actually being a user of stack exchange :P a user uploads a zipped file with a bunch of files (.shp and .dbf) then the server reads them in, normalizes it into the db. For saving space, it runs a binary compression algorythm at some point before it hits our db :) Is that specific enough? – user2804240 Jan 25 '16 at 15:33
  • it's not an esri database, it's a very geo focused db structured I will retag it :) Thanks! – user2804240 Jan 25 '16 at 15:37
  • @user2804240, any chance this blob is from an ESRI Annotation Feature Class table (layer)? ESRI stores a proprietary blob format in their annotation layers. Otherwise ..is it the geometry field, itself? Can you cast it as follows in a DB Query: SELECT STAsText(blob_field) AS wkt FROM blob_table; ?? – elrobis Jan 25 '16 at 18:47
1

a user uploads a zipped file with a bunch of files (.shp and .dbf)

It sounds like you're looking for a shapefile technical document. ESRI has one published at this link:

http://support.esri.com/en/knowledgebase/whitepapers/view/productid/21/metaid/279

There are a lot of open source shapefile tools, like Pyshp so you don't need to create your own.

edit: Reading blobs out of a database should be pretty easy with pyodbc - do a query and then write to a binary filehandle with f = open('users_zipfile.zip', 'wb')

| improve this answer | |
  • it's not a shp file....it's a blob the blob is posted on reddit if you want to read it reddit.com/r/codes/comments/421xek/… the user uploads, but the application server translates the uploads to blobs – user2804240 Jan 25 '16 at 17:02
  • 1
    A blob is just an arbitrary field to hold binary data. (Binary Large Object) You converted the blob to a hex string in the reddit post. If you were to write the binary from the blob to a file on disk and give it a .shp extension, you would probably end up with a shapefile. -edit- it looks like the user is uploading zips, so try unzipping the binary data. – Mintx Jan 25 '16 at 19:53
  • so I am dealing with a hex string? Not a blob? this hex string is EXACTLY what comes out of the db! Sorry for being unclear by saying help me read this blob. how do i turn a hex string into a .shp file? Sorry I am so amateur at this! Your help is really appreciated! :) – user2804240 Jan 25 '16 at 22:15
  • 1
    I'm not familiar with Azure, but you should be able to "describe" a table and get the data type. If you see a VARCHAR (or similar) data type then you are dealing with hex strings. If you see BLOB then it is raw binary, which was converted to hex for you when you exported it, since that is the most common way to view raw binary data. In SQL, the command is normally desc tablename – Mintx Jan 25 '16 at 22:47
  • it shows varbinary(max),null)... but if i copy and paste what i see in sql server management studio, it's that hex string – user2804240 Jan 26 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.