Hello all,
I'm using geo-6.x-1.x-dev.tar.gz, Drupal 6.12 and Mysql 5.0.67-0ubuntu6 (new to Drupal, but learning).
Whenever I attempt to import a shape file, I always get an error message similar to the
one below. The message says the import was successful, but it's not- there's nothing in
the database geo_shp_ table except for the header line. It seems like the
GeomFromText('P', 4326) part is wrong. From examples I've seen on the net, maybe it
should be more like :
GeomFromText('POINT(71 97)', 4326) . No matter what data set I use, local, US Census, or
3rd party sources, I still get this same error.
However, if I put into SWL something like GeomFromText('POINT (1 1)', 4326) , the
insert go through-- but with nothing in the 'geo' field'. Thanks for any help. If this
worked completely for us, this would be a wonderful tool for us! :)
here's the ERROR:
user warning: Column 'geo' cannot be null query: INSERT INTO geo_data_facilities (
sde_facili, perimeter, fac_, fac_id, address, name, facility, d_oct92_, d_oct92_id,
d_oct92_s, type, sectors_, juris_, geo ) VALUES (0, 0, 0, 125, '3517 N HILSHIRE BLVD',
'CENTRAL LOCAL', 'POST OFFICE', 0, 0, '', 0, '', '', GeomFromText('P', 4326)) in
/var/www/html/modules/geo/includes/shp2sql.inc on line 94.
Import complete. 234 rows imported into geo_data_bicycle_routes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | bike_routes.zip | 325.48 KB | treyuta |
Comments
Comment #1
allie mickaInteresting. You're correct to note that "GeomFromText('P', 4326)" is invalid. Are you able to provide the shape file?
Comment #2
treyuta commentedhi, Thanks for the quick response. :) Please see the attached file containing the bicycle routes. Thanks for looking into this issue.
Comment #3
apolzon commentedI ran into the same issue, and was able to resolve it. The shp2sql include is expecting the POINT() representation of the data row to be in $shp['data']['wkt']. This is not the case, so I was able to fix it by changing that to $shp['data'] for the $shp['geo_type'] == 'point' case. I'm still having issues with linestrings, but thats a topic for another issue.
I can't give the exact line number this occurs on, but it should be near line 89 in geo/includes/shp2sql.inc
Comment #4
allie mickaThere are now 3 issues that suggest similar problems. Please try and see if there is already a similar issue before filing a new one - that saves everyone a lot of time!
treyuta , can you see if the changes at #640704: Shapefile Parsing Issue fix this? If so, please follow up there. If not, please reopen _this_ ticket.
Thanks!