Hot answers tagged

6

The question has indeed been asked before, but it is still a good question :) The manual already gives you a hint towards the problem. The main problem is that you are trying to use geograpy types (that work with real world coordinates) while the function st_intersection is not completely ready for geography. In the real (spherical) world, your geometries ...


5

The column format for PostGIS is called geometry and you'll probably need to read up on all the functions associated with managing spatial columns. If you are getting the lat/longs from GPS or Google, the projection will be EPSG:4326. edit: iant's comment brings up a good point about the geography type, and indeed if you are using EPSG:4326 it looks like ...


4

It looks like SELECT ST_AsText (ST_CENTROID(pol8.geom) AS geom should be SELECT ST_AsText (ST_CENTROID(pol8.geom)) AS geom note the second ) - when in doubt count from left to right +1 for each ( and -1 for each ) if you don't reach 0 at the end then you have missed a bracket.


4

QGIS has its own internal handling of layers and features. Different data "providers" are used to pull layers in from a variety of sources (eg PostGIS, OGR file types, WFS servers, etc) and translate them into QGIS' own internal formats. Once you have a project fully loaded, including a .shp file plus a .dbf, plus another CSV joined, are all the data in ...


3

Osmium is a very fast and flexible C++ library for working with OSM data: http://osmcode.org/libosmium/ It supports all types of osm entities such as nodes, ways, relations and even historical osm data. It's published under Boost Software License and therefore free to use.


3

1500x750 is pretty big for a raster. Definitely worth retiling your data. Take a look at ST_Retile function (new in PostGIS 2.2) - http://postgis.net/docs/manual-2.2/RT_Retile.html or if you are using PostGIS 2.1, you can use ST_Tile instead which achieves same purpose on a per row (instead of per table basis) ...


3

You can confirm that the discrepancy is a bug by comparing the results of _ST_DistanceUnCached(geog,geog) to _ST_DistanceTree(geog,geog) What is happening under the covers is that the "tree" algorithm only kicks in when a geometry shows up in a query a couple times in a row. At that point the geometry is cached and a tree built on it, for faster distance ...


2

Import the Shapefile that contains the feature into PostGIS (keeping them in the same SRIDs) then just select the geometry of the feature (can view the data and go to the particular row and double click the geometry) and copy paste it into the row with the NULL geometry.


2

The error you're getting is because you're trying to restore a database created with an old version of PostGIS (2.1) to a newer version (2.2). I would recommend trying to downgrade your PostGis version to 2.1.x by using the following command in your database, assuming you have no data loaded in it (Please backup your current DB if you do!) DROP EXTENSION ...


2

I'd check the following: first of all, I'd like to be sure that source data are OK, by comparing them with official/cadastral data I'd try to use the qgis openlayers plugin to check if the transformation to 3857/900913 works properly for both 23031 and 25831 Try to reproject using QGIS, just saving the shapefile with the target srid. If using QGIS works ...


2

Your original trigger contains an error: CREATE TRIGGER area_calculate **BEFORE** INSERT OR UPDATE ON nutzungen This means that you're triggers calls the function on geom before the geometry is updated. Replace the trigger by calling the following: DROP TRIGGER area_calculate; CREATE TRIGGER area_calculate AFTER INSERT OR UPDATE ON nutzungen FOR EACH ...


2

You must convert point coordinates to geometry SELECT ST_Within(St_GeomFromText('POINT(-73.883573184 40.751662187)'), ST_GeomFromGeoJSON(d));


2

I used Buffer to limit out the points and then calculated bearing between buffer points(coordinates) and saved that in MySQL table. Nearest Neighbor and bearing gave me next point of road.


2

The problem is that SQL view in geoserver doesn't allow to use semicolon(';') in SQL statement. Geoserver only allows one query statement. You didn't provide the structure of Your database, but may be it's possible to build SELECT query with subquery and get the same result.


2

They're two different representations of the same binary data. SET bytea_output = 'hex' will switch to the hex representation that it sounds like you want. Here's a couple of examples: postgres=> SET bytea_output='escape'; postgres=> SELECT ST_AsBinary('POINT (24.3 41.7)'::geometry); st_asbinary ...


2

Your logic seems sound, but you have some surplus text in your query which throws an error: "::geometry(linestring, SRID)" is not required. Also note that ST_ExteriorRing() does NOT work on multi-polygons, only polygons (null will be returned from multipolys, which may explain your lack of results). Also if you are using more than one polygon in each table, ...


1

Complementing, previous answer.. montevideo-release-v4 is the latest branch. There is a lot of clean up that needs to be done as everything we coded is still there even if its not used.


1

ALTER TABLE planet_osm_line ADD COLUMN vertices INTEGER; Why float? Are there fractional vertices? You are also inserting records, when I think you actually want to update each way with the number of vertices within. Use an update function to add the values to the new column based on the result of the function operating on the spatial column. For example, ...


1

Solution: 1) Use psql in the command line instead of loading with the SQL editor. 2) If you're using Windows and not logged in as postgres, add the -U flag to: psql -d postgis_in_action -U postgres -f ..path/ch11_data.sql -- for some reason, the username is not being picked up from the pgpass.conf file.


1

I use the Gridded Soil Survey Geographic (gSSURGO) by State data provided by Geospatial data gateway. Two Geodatabases are provided with the download (gSSURGO_PA.gdb, valu_fy2016.gdb) along with a User Guide on how to use the data. Inside the gSSURGO_PA.gdb you will find a raster called "MapunitRaster_PA_10m" and a featurclass called "Map Unit Polydons - ...


1

You can use the build in import plugin that is installed when you install the PostGis extension in PostGres You can find it under Plugins in the menu and is called the PostGIS Shapefile and DBF loader watch this youtube video as an example



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