Tag Info

Hot answers tagged

3

To begin with you might consider using ST_DWithin instead of creating a buffer and using ST_Intersects. It will be faster and simpler. That being said, to get all the points that are in one buffer but not in both buffers you need to get the symmetric difference of both sets. Symmetric differences look something like this: (a EXCEPT b) UNION (b EXCEPT ...


2

See the Discrete Global Grids site, specially their software and the grids they've pre-generated. These generate the grids as vectors and you should be able to import them into postgres.


2

ST_ClosestPoint will find the closest point on a linestring. For example, locating a point on a road that is closest to a point-of-interest off to one side: SELECT ST_AsText(ST_ClosestPoint(road, poi)) FROM (SELECT 'LINESTRING (10 10, 20 20)'::geometry AS road, 'POINT (14 10)'::geometry AS poi ) AS f; st_astext -------------- POINT(12 12) (1 row) ...


2

The pair that you want is PG_Dump and PG_Restore... I use PG_Dump on a scheduled task to backup our PostGIS databases in a format that can be restored easily - and more importantly will work! pg_dump.exe --file=c:\Your\path\BACKUP_Name.Backup -Fc -Z9 -o DatabaseName Custom format Z9 compression (to save space) Include objectIDs and then to restore on ...


1

PROJ.4 uses the position vector method for its 7 parameter transformations. The ArcGIS transformation that you're referring to uses the coordinate frame method. They use different conventions for the rotation values, so switch the signs on the rotation values and retry. General information: To change the direction of a 7-parameter transformation ...


1

For PostGIS, make sure you are following the hard upgrade procedure: pg_dump -h localhost -p 5432 -U postgres -Fc -b -v -f file.backup thedatabase This way it can be restored in the existing database, or it can be discovered with a future version of PostGIS using the postgis_restore.pl command. For Windows, you need to tailor a simple BAT file described ...


1

The query is the following: "SELECT row_to_json(f) As feature \ FROM (SELECT 'Feature' As type \ ,ST_AsGeoJSON(%s)::json As geometry \ , row_to_json((SELECT l FROM (SELECT id AS feat_id) As l)) As properties \ FROM shapefile_feature As l WHERE l.id = %s ) As f;" % (geometryField, feature.pk) output: { u'geometry':{ ...


1

I would say that the ideal situation is to store everything in one table, with the same srid. However if that is not ideal in this case, I would consider creating a view that does an st_transform on the geometry to the srid you want and then use that to view in qgis.


1

IN your query with "ST_Intersects(...)='t'" you are getting what you expect because each village is tested against all wetlands, and when any intersection is found, the name is returned. In the first query "ST_Intersects = 'f' ", villages are again tested against all wetlands, and if any one of them is false, the village name is returned. Each village is ...


1

Try this: select distinct v.name from villages v left join wetland w on st_dwithin(w.geom,v.geom, 0) where w.<some_attribute> is null; The left join will return a record for everything in villages, but you will only get attributes populated when you have a st_dwithin match. So if you limit to the null's, you should have the items that do not ...


1

As many have already said, the availability of drivers in rgdal in R for both raster and vector data always depends on the underlying GDAL installation. If that has the driver, then it will work on readGDAL/writeGDAL or readOGR/writeOGR. If it does not have it, you need to upgrade your own GDAL and reinstall rgdal. Most questions about drivers come from ...


1

The ST_ConvexHull function is implementing the Simple Features specification portal.opengeospatial.org/files/?artifact_id=13228 which says that "simple features are based on 2D geometry with linear interpolation between vertices". Therefore you get a flat polygon as a result.


1

I fix it, just have to use first of all the function st_linemerge, then use the function st_makeline and finally use ST_line_interpolate_point. ST_line_interpolate_point(st_makeline(st_linemerge(geom)),fraction);


1

The elevation service on ArcGIS Online includes ready to use worldwide data, and also a built in raster function to generate aspect. It's also pretty simple to filter simultaneously for a range of aspect values (290-250 degrees) as well as elevation (e.g. 0 to 10 meters, depending on how you define a beach - or perhaps you already have the beaches ...



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