imported shape file data not formatting correctly in the geo field
elgringopelon - August 12, 2009 - 22:30
| Project: | Geo |
| Version: | 6.x-1.x-dev |
| Component: | Geo Data module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
I am trying to import a shape file from MassGIS - the Massachusetts Senate Legislative Districts (see attached). All the fields import correctly except for the geo field, which is filled with a very long string of random characters. I get the error #1416 - Cannot get geometry object from data you send to the GEOMETRY field when trying to edit the row in phpMyAdmin.
The MassGIS system uses SRID 26986.
I am running php 5.2.9, Apache 2.2.11, Drupal 6.13, and MySQL 5.0.81-community.
Any ideas why the data won't import correctly?
| Attachment | Size |
|---|---|
| Senate.zip | 426.13 KB |

#1
I think this is working as designed?
MySQL Spatial stores its data in a binary format. You can get the data out again by using one of the functions as described at http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html .
I was able to import this table using the geo_data module at admin/build/geo , and I was able to use queries such as "SELECT AsText(geo) FROM geo_data_senate;" and "SELECT AsText(Centroid(geo)) FROM geo_data_senate;"
MySQL doesn't really do anything helpful with the SRID, and it doesn't support any transformations on projections. It's likely you want to convert this to Drupal's default SRID prior to importing it.
Thanks!