Tag Info

Hot answers tagged

4

The best CRS for making equidistant circles is a custom azimuthal equidistant projection based on the center point: +proj=aeqd +R=6371000 +lat_0=51 +lon_0=7 After creating the circle, you might need to densify the geometries. Displaying the circles in any other CRS might give you ellipses, but that's the difference between equidistant and non equidistant ...


4

The short answer is you can't do that unless your points are very close together and you want the answer in degrees. JTS knows nothing about units or the curvature of the earth. So you need to pull in some GeoTools jars that do know about such things. Then you can create a method like: private void calculateDistance( ...


4

You can bind a trigger function to as many tables as you want; just execute a CREATE TRIGGER statement for each binding. Make sure to schema-qualify the table name in your statement (BEFORE INSERT OR UPDATE ON a.point etc.) If you have a large number of schemas, you could generate the SQL dynamically by iterating over the rows in ...


3

One of the best place to search and explore source code for PostGIS is through the GitHub mirror: https://github.com/postgis/postgis For instance, search ST_DWithin, where you will then search LWGEOM_dwithin, then lwgeom_mindistance2d_tolerance, then lw_dist2d_comp, then lw_dist2d_recursive, and then different versions of lw_dist2d_distribute* ...


2

SELECT usdma.geom FROM usdma, usstates WHERE ST_Overlaps(usdma.geom, usstates.geom) AND usstates.name = 'TX'; I'd rather go for ST_Intersects or ST_Within though.


2

I think using ST_SetValues is better. The reason is the wkb structure of raster may change in future version so your code may break at that point. ST_SetValues since its a user facing function will always be updated to be inline with internal structure. Also forgot to add -- that's an old ancient doxygen link when raster was separated (and www.postgis.org ...


2

As an approximation suitable for medium-small radii, use the cos() of the latitude to scale up the true distance to a "distance" that makes sense for your latitude in web mercator, as described here. SELECT * FROM mytable WHERE ST_DWithin( ST_Transform(ST_SetSRID(ST_MakePoint(%lon, %lat), 4326), 3857), the_geom_webmercator, %radius / cos(%lat * ...


1

I think this is answered at here. To me, the best is using QGIS plugin called Multi Ring Buffer , details at here.


1

I think the module your looking for is pyshp. if it isn't installed, open your osgeo shell and enter easy_install pyshp


1

You could use the Java implementation of GeographicLib to solve the inverse geodesic problem on WGS84. import net.sf.geographiclib.*; ... private double calculateDistance( double lon1, double lat1, double lon2, double lat2) { GeodesicData g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2); return g.s12; // distance in ...


1

I think you could use the following code to obtain source information for your layer. Select a layer from the layer window and input the code into the Python Console: layer = qgis.utils.iface.activeLayer() print layer.source() You should receive information about the layer. Hope this helps!


1

I assume it's running into trouble when you try to route from one part on the network to another part which is disconnected due to closure (e.g. when link 58-47 is removed). Instead of removing these links, try to put their costs really high. That way, you will be able to identify those links which get disconnected by their high cost sums.


1

You can get the shortest route between two points using PostGIS with ST_Distance (if you want to know the distance) or with ST_MakeLine (for the geometry): http://postgis.net/docs/ST_Distance.html http://postgis.net/docs/ST_MakeLine.html If you want to use the network for routing, then you need a network topology. You could try something like pggraph, ...


1

SELECT category, ST_Union(geom) geom FROM s.road GROUP BY category; You might want to use ST_Dump() afterwards not to have multilinestrings in the result.


1

How big is your dataset? You could create a fishnet grid in postgis See here Then you could interpolate your raster with your grid with various tools (gdal/qgis): see here Dont forget to index your grid to optimize speed. Good luck


1

Pros: It's a high performance and flexible key/value that can be indexed and queried. I have a complex schemaless web GIS that uses an HStore column for storing the features properties. Cons: Most WMS/WFS tools like Mapserver, Geoserver and similars can't understand and work with HStore columns, so you end up creating hard coded SQL Views (In Geoserver ...



Only top voted, non community-wiki answers of a minimum length are eligible