Make a (copy of a) postgis database available to customer?
Our application uses a PostgreSQL database (with the PostGIS spatial extension). Now one of our customers has requested direct access to the database; because, as they claim, it’s their data. We’d...
View Articleogr2ogr Set Feature to Column Name?
I’m converting PostGIS data to PDF via GDAL 2.0.2 with below. ogr2ogr -f “PDF” mypdf.pdf PG:”host=domain.com user=me password=mypassword dbname=mydb” -sql “SELECT geom, state_name, sub_region,...
View ArticleArea of influence with CartoDB
I am working on a city transport map, and for fun (and practice) I try to make an area of influence of transport station. But, whatever I try, something gets wrong. So two questions. 1 – How can I fix...
View ArticleProblem with projection in pgRouting layer in GeoServer
I followed this tutorial for creating a pgRouting layer in GeoServer. When I try to publish this layer Native Bounding Box and Lat/Lon Bounding Box are not getting generated correctly. For my road...
View ArticleChecking if a polygon contains multiple point geometries using PostGIS?
This is not a a duplicate of the “Count Points in Polygon with Postgis“, since in the ST_Contains(geometry geomA, geometry geomB), this case has two geometries (start_geom and end_geom) in geomB, while...
View ArticleInterpolating point to nearest polygons to compute street width in posgis
I am trying to calculate the width of streets (line.shp) in postgis using reference point (ref_point.shp) (yellow point features) and building polygons (building.shp). The red point features are the...
View Articlelike finding errors overlap on the same layer in postgis?
After meeting the overlay erroneous polygons in the same layer, I used the following query: select gid from limite_localidad where not ST_Overlaps(the_geom,the_geom) I have to leave 108 records error...
View ArticleHow to replace a part of OSM data in postgres?
i want to replace the apart of osm data in postgrs database. for example ,replace the osm data of china which in planet osm data. i hava used osm2pgsql, but if use osm2pgsql import the china data ,it...
View ArticlePostGIS ST_Intersects GeometryCollection
If i’m not terribly mistaken, ST_Intersects does not support GeometryCollection. ERROR: Relate Operation called with a LWGEOMCOLLECTION type. This is unsupported. HINT: Change argument 2:...
View ArticleLeveraging capabilities of PostGIS for large (ish) tables in PostgreSQL?
I am using PostgreSQL and PostGIS to do some exploratory analysis and eventually spatial analysis. I have a table with 40M+ points (geolocated tweets) in the United States that has a spatial index. I...
View ArticlePostGIS: how to merge contiguous features sharing same attributes values?
I have a big postgis table storing line features. I woud like to merge features that are both connected to eachother and have given attribute values identical. Here is below an example of what I’d like...
View ArticlePython GDAL open dataset in PostGIS with quotations
Error trying to use gdal to open a dataset in PostGIS with the following code: ds = gdal.Open("PG: dbname=nyc host=localhost user=postgres password=mypassword port=5432 mode=2 schema=public column=rast...
View ArticleAdd SRID to Point
When inserting a point into a PostGIS database I do it using ST_GeomFromText('POINT(0 1 2)',26918). Note that this was done on a tutorial database where the SRID was set manually as explained here Now...
View ArticleHow to use gdal_rasterize with postgis vector?
I’m trying to convert a multipolygon vector layer to a raster using the GDAL tool gdal_rasterize. The command I am using is: gdal_rasterize -b 1 -burn -9999 PG:"dbname=db password=password" auckland...
View ArticleHow to calculate width and lengths of street layer in Postgis/PostgreSQL?
I was able to project the point location (ad.shp) to the nearest street (line.shp) like this. My approach was like this. I used ST_ClosestPoint() to iterate this for every point location within a...
View ArticleUpdate one table from another based on spatial join
In beginning i had two tables of points and i wanted create from one of this POINT table new table CIRCLES which will contain circle polygons 300 metres around points. This step i have done here:...
View ArticleHow can I add the PostGIS extension?
I’m experiencing difficulties when trying to add the PostGIS extension to PostgreSQL. I wasn’t able to add the extension during the installation because of an error. Now I’m trying to add the extension...
View ArticleHow to check point intersection with bbox made from two points?
I have two points which represents lower left and upper right point of BBOX. I have one point which SHOULD be somewhere inside and I want to test it. I have all of them as ‘geometry(POINT, 4326)’ data...
View ArticleImplementing spatial autocorrelation (global and local moran's) using PostGIS?
Has anyone tried to count global and local moran’s index for polygons inside PostGIS database, with defined neighborhood relations as queens? Is it even possible? I could use R, but my goal was to use...
View ArticleDistance measure of ST_ClusterWithin
I use SRID 4326(WGS 84). So what is the measure of distance in ST_ClusterWithin . m, km, degree ? I ask it because in documentation it only says: geometry[] ST_ClusterWithin(geometry set g, float8...
View Article