I'm currently trying to import a bunch of boundaries into a legacy system with a specific SRID
. its a mySQL
db.
After import and running some intersect code, i receive this error:
Binary geometry function st_intersects given two geometries of different srids: 1 and 0, which should have been identical.
As it says, there is an srid
mismatch of 1
vs 0
. The newly imported boundaries are SRID 1
, the existing boundaries from another table (cannot be changed) are SRID 0
. I have established this with mysql command
select ST_SRID(boundary_polygon) from boundaries;
My question, what EPSG
value would i use with ogr2ogr
's -a_srs
flag. I want to force SRID=0?
Here is the current command i'm using for import:
ogr2ogr -f "MYSQL" MYSQL:"blahdb,host=localhost,user=blah,password=blah,port=3306" boundaries.tab
I'm currently running this command which forces the import to SRID=0
which seems by convention to mean No SRID.
UPDATE boundaries SET boundary_polygon = GeomFromWKB(boundary_polygon, 0);
This then allowed my st_intersects method to work fine and find intersect between two polygons.
However, I still need a way to import as SRID=0 from ogr2ogr instead of SRID=1. So that I don't need this post import SQL step
-a_srs EPSG:0
into your ogr2ogr command but I fear that it fails.ERROR 1: Failed to lookup UOM CODE 0
SRS information is stored using the OGC Simple Features for SQL layout, with geometry_columns and spatial_ref_sys metadata tables being created in the specified database if they do not already exist. The spatial_ref_sys table is not pre-populated with SRS and EPSG values like PostGIS. If no EPSG code is found for a given table, the MAX(SRID) value will be used.
I would check what spatial_ref_sys contains. Perhaps you can fiddle the MAX(SRID) into "0",spatial_ref_sys
it indeed only has a single record with SRID = 1. I assume if I change this value, it will default to 0 from then on?spatial_ref_sys
allowed changing default to 0.