sql - Running PostGIS Commands on Clustered DB -


using postgresql in clustered database (stado) on 2 nodes, want test query:

select id,position,timestamp table t1 id!=0 , st_intersects ((select st_buffer_meters(st_setsrid(st_makepoint(61.4019,15.218205), 4326) ,1160006)),position) , timestamp between '2013-10-01' , '2013-12-30'; 

when run in command line or psql (on coordinator), error:

encountered ")" @ line 1, column 171. 

while other sql commands (insert, update, select... etc) working fine. geometry columns seems okay in table don't think there problem installing postgis.

generally-speaking, don't buffer geometry proximity search. above attempt, 1 point geometry, in other queries potentially buffering geometries of table, make query expensive since need create new geometries , not able use indexes. use st_dwithin instead.

st_dwithin geometry types use same distance units the spatial reference system. srid=4326, in degrees, not helpful in way. however, if position geography type, st_dwithin use distance arguments in meters, more useful. filter like:

where id <> 0   , st_dwithin(st_makepoint(61.4019, 15.218205)::geography, position, 1160006) ... 

this proximity search of positions 1160006 m or 1160 km queried location (which, way not in sweden, if that's thinking). if position geometry type, can either consider changing type, or cast (position::geography) or index of cast operation.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -