Tag Info

New answers tagged

0

I think your problem is related to using ST_Union. Because, if, for the same A.id, you end up with overlapping geometries then ST_Union will merge them together, which is not what you want. Try using ST_Collect in place of ST_Union.


2

You are looking for ST_Reclass. There are three types of function signature, essentially differing on how you pass the reclassargs, which is essentially a textual encoding for mapping input to output pixel ranges. UPDATE bin_rast SET reclass_rast = ST_Reclass(bin_rast, 1, '0:-999, 1:100', '8BUI', 0) WHERE rid = 1; where obviously you will need to put in ...


0

And you can find a similar example including a shortest path query in the pgRouting workshop: http://workshop.pgrouting.org/chapters/wrapper.html#route-between-lat-lon-points-and-return-ordered-geometry-with-heading Taken from within the function this is similar to yours without the distance: SELECT id FROM ways_vertices_pgr ORDER BY the_geom ...


0

I found this link: http://www.sqlexamples.info/SPAT/postgis_nearest_point.htm based on which, I created the following function: CREATE OR REPLACE FUNCTION get_nearest_node (IN x_long double precision, IN y_lat double precision) -- input parameters RETURNS TABLE -- structure of output ( node_id bigint , dist integer -- distance to the nearest station ) ...


1

Given Paul Ramsey's excellent explanation of why the next question is what can be done about it. How do you SELECT DISTINCT on geometry fields and have it perform as expected? In Paul's answer, I proposed using SELECT MAX(geom) FROM the_table GROUP BY ST_AsBinary(geom); but MAX() is slow, apparently requiring a table scan. Instead, I found this to be ...


2

ST_DWithin uses units which match your geometry's CRS. Since your geometry has a CRS of 4326 the distances used will be in degrees - not very helpful! However, if you use 'geography' types rather than 'geometry', then ST_DWithin always uses metres for distance. So, you'll need to first convert your geometry into a geography type, so that the measurements ...


5

All the measurements are always returned in the units of chosen CRS. WGS84 is defined in degrees of latitude or longitutde, thus it returns results in degrees. If you want to obtain results in meters, you have two options: Start using geography type Reproject your data into national coordinate system defined in meters


1

In general, there is more support for the geometry than the geography data type, see function comparison matrix. For your type of query, classic point in polygon, I think you can use the geometry datatype, setting the spatial reference ID (SRID) to 4326 (lat/lon). See, this thread on the difference between geography and geometry for more info. The gist ...


0

Bit late to the party, but I'll answer anyway 1. Connect to GeoServer cat = Catalog('http://localhost:8080/geoserver/rest') 2. Create a Workspace ws = cat.create_workspace('newWorkspaceName','newWorkspaceUri') 3. Create PostGIS store ds = cat.create_datastore(newDatastoreName,newWorkspaceName) ds.connection_parameters.update(host='localhost', ...



Top 50 recent answers are included