Posted by tjhellmann on August 12, 2009 at 10:30pm
Jump to:
| Project: | Geo |
| Component: | Geo Data module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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 |
Comments
#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!
#2
I'm going to go ahead and close this for lack of feedback. I think things may have been working OK, but if not, please feel free to reopen!
Thanks!