Tag Info

New answers tagged

0

First of all, ST_Distance_Sphere returns in meters, so you are actually looking at 8km, which might be more reasonable. I suspect, also, that you have you lat/lon the wrong way round -- your point is somewhere off the coast of the Seychelles, not Carlisle, and there are not too many roads in the Indian Ocean. Also, while the query planner will optimize this ...


3

You don't need constraints for PostGIS 2.x, just us typmods. For 2D geometries with SRID=4326, the typmod is geometry(Geometry,4326). Or for M-dimension geometries, it would be geometry(GeometryM,4326) (you get the idea). Example: create temp table sometable(wkt geometry(Geometry,4326)); -- works insert into sometable(wkt) values('SRID=4326;POINT(1 2)') ...


2

@BradHards is right. Having mixed types is probably going to cause problems down the road. If you're sure your tools can handle mixed types, or you're going to be retrieving them some other way (through DB views, or programatically) you can split the constraints into two parts, either of which is optional: To modify your existing table -- Only check the ...



Top 50 recent answers are included