1
vote
1answer
33 views

PostGIS get geometries within a radius of n meters using WGS84 [duplicate]

select * from zones z where st_intersects(z.geom, st_Buffer(ST_SetSRID(ST_Point(2.336031, 48.863172), 3857),1)); It looks like the 1 in the st_buffer is being interpreted as degrees, I need to find ...
0
votes
1answer
34 views

selecting elements of a specific geometry type in PostgresSQL/PostGIS

I was reading a postgis tutorial and noticed that unlike working with shapefiles, one can actually store different types of geometry in postgres. In a table created with multiple geometry types, the ...
3
votes
1answer
46 views

Extract longitude latitude and radius from POSTGIS column

I have entered the circle in the Geometry type column (name=shape) in my POSTGIS as following: ST_Buffer(ST_MakePoint($longitude, $latitude)::geography, $radius)::geometry Then I extracted the ...
1
vote
0answers
43 views

Why does the postGIS file lose geometry?

I am loading shapefile data from a GPS into PostGIS via Leica ZenoOffice. This apparently imports fine with it's geometry in the attribute table. However, when I add a postGIS layer in QGIS the file ...
1
vote
2answers
100 views

Export polygon in geojson as multipolygon

Anyone knows if is there any way to export a polygon layer in geojson, as multipolygon? I have a multipolygon shapefile. But there are single and multi polygons. When I export it to geojson, I got ...
1
vote
1answer
37 views

Geometry error in roadnetwork

I have a road network table. When I check st_isValid(the_geom)='f', I am getting an error: NOTICE: IllegalArgumentException: point array must contain 0 or >1 elements ERROR: Exception in ...
1
vote
1answer
48 views

Is there a PostGIS function to get a tangent and normal line?

I'm looking for a function that will return a tangent (and normal) for a LINESTRING in PostGIS. I think this is the 3rd time I've come across the need for this function and everytime, I end porting ...
2
votes
1answer
54 views

Delete duplicate polygon nodes with PostGIS

I'm trying to delete duplicate nodes from a shapefile with QGIS, but after running the tool to delete it, nothing happens and shows the same errors. I thought that maybe importing to postgis could be ...
2
votes
3answers
59 views

How to display a table with more than one geometry column in QGIS?

In PostGIS, it is possible to use addgeometrycolumn more than once on the same table. Example: I have one table "scenes" with many attributes, and 2 geometry columns: the_geom1 and the_geom2. select ...
1
vote
1answer
55 views

GeographyFromText and ST_SetSRID+ST_MakePoint different results?

Why am I getting different results? SELECT ST_DISTANCE( ST_GeographyFromText('SRID=4326;POINT(13.401111 52.383343)'), --berlin ST_GeographyFromText('SRID=4326;POINT(9.997559 53.533778)') ...
0
votes
1answer
49 views

PostGIS change column type varchar => geometry

I have a Postgres database with PostGIS extension on it. Also, I have a table with column lat with type (varchar 40). Column values are like this: 52.1432514 52.1431855 52.1431586 I want to convert ...
2
votes
1answer
66 views

How to get the width and height of a rectangular polygon in PostGIS

I have a table with point features saved in the my PostgreSQL database, and I can run the following query to get the extent of the point features and I turned the extent back into a geometry: SELECT ...
0
votes
1answer
54 views

Geometry to Shapefile

From importing the shapefile to postgis, its geometry is added to the database postgresql. The question, how can I load the shapefile in the Visual Basic.Net using the geometry in the database ?
1
vote
1answer
290 views

Is it possible to get a binary geometry from PostGIS?

PostgreSQL (via C# Npgsql driver) returns geometry column (PostGIS) like a hex string (EWKB as I understand) for this query: SELECT ST_Transform(geometry, 4326) FROM myGeometries; Result (for ...
1
vote
0answers
43 views

PostGIS automatically creating geometries after importing using QGIS DB Manager

I have a shapefile consisting of linestrings, in which some of the features have null geometry. Yet, after importing it to PostGIS, using QGIS' DB Manager, a geometry is created for those features ...
3
votes
2answers
88 views

How do you determine how straight a LineString is? [duplicate]

I have a bunch of LINESTRINGs and need to classify them based on how strait they are. My idea is to compare the length of the LINESTRING to the distance between the first and last POINTs. I'm ...
4
votes
1answer
165 views

Configuring Geoserver to use a specific postgis geometry column as the default

I have a PostGIS table with two geometry columns, both multipolygon but one with SRID 4326, the other 3857. When publishing the table in Geoserver, I realize that Geoserver defaults to using the first ...
0
votes
1answer
37 views

Postgis add Geography to function()?

i was wondering im getting different results when using geography() on different positions within a query. So, whats the most accurate way of forcing geography() over a functions with geometry ...
2
votes
0answers
57 views

PostGIS does not export shortest path to Shapefile

I am trying to draw a bunch of lines overlaying the globe map in a WGS84 projection. To this effect I have created a PostGIS DB with a table that has one column containing linestring data. My problem ...
1
vote
3answers
116 views

Geometry vs geography for line-to-polygon intersection

I have two WGS84 NAD83 shapefiles, one polygonal, the other containing lines: Geometry: Polygon Feature Count: 1294 Extent: (-79.761059, 44.991143) - (-57.105486, 62.582865) Layer SRS WKT: ...
0
votes
0answers
42 views

Speed drastically reduced when including geometry, is there a way to improve?

-- EDIT: Issue is that the shape files being used are at too small of a precision and way too large, output was 488M total, looking for different source -- I'm having some speed issues with a complex ...
3
votes
1answer
164 views

Get geometry column back when counting points in polygon using PostGIS

I have two PostGIS tables: earthquakes and borders, which contain point data on earthquake locations, and polygons of countries in the world respectively. I want to try and count the earthquakes ...
2
votes
1answer
332 views

Multipoint vs point PostGIS

Is it normal to use the geometry type 'multipoint' instead of 'point' knowing that I use it to store only one point. How can I convert from multipoint to point
5
votes
3answers
102 views

What is the PostGIS 2.x equivalent of the pre-PostGIS 1.5 ~= operator?

Stemming from my other question: When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?, what is the PostGIS 2.x equivalent of the pre-PostGIS 1.5 ~= operator? It ...
2
votes
1answer
84 views

When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?

I have a couple of featureclasses in a 10.2 geodatabase/PostgreSQL 9.2.2 database and I've been struggling with the FeatureCompare tool--it is telling me geometries are different on some features ...
8
votes
1answer
285 views

What is the precision of SELECT DISTINCT on PostGIS geometry column?

I wonder what the precision of the SELECT DISTINCT operator is on a PostGIS geometry. On my system, the following query gives me a count of 5, which means that the inserted points are considered equal ...
1
vote
0answers
139 views

pgRouting results to LINESTRING geometry type

I am doing some routing queries, using pgRouting's second version of pgr_trsp function. What I can't do effectively yet is storing the results. That is, I want to able to store in a table: either ...
0
votes
0answers
30 views

Identify primary routes in Postgis

I have a table of linestrings that make up a route network. I want to identify the primary routes and separate out the interconnections. Problem is that the primary routes are split into separate ...
1
vote
1answer
95 views

Clip geometries in table based upon value

I have defined a view in postgres that returns a set of polygons and can be queried as follows:- SELECT wkb_geometry, grade_count FROM ng_schema.grade_count_report [sql.where] order by grade_count ...
0
votes
1answer
77 views

Missing a Geom field in PostGis

I am working in a Database preaparation for that I exported a shapefile from Qgis to PostGis.The Problem is this: In Qgis I can see a Polygon feature but when the same polygon feature is exported to ...
5
votes
1answer
336 views

How is ST_PointOnSurface calculated?

The PostGIS documentation states that ST_PointOnSurface returns "a POINT guaranteed to lie on the surface". It seems like this function could be trivially implemented to give results that satisfy the ...
1
vote
1answer
72 views

PostGIS Geometry folder is missing

I have installed PostgreSQL 9.2 and PostGIS 2.0.3 from Stackbuilder. My template_postgis_20 does not have a geometry table only spatial_ref_sys table. Is that a problem? and if not how can i create ...
2
votes
1answer
40 views

How to generate features to test different implementations of LinearRing?

I have some code that throws the following exception: Points of LinearRing do not form a closed linestring and I want to check if my code is calling this correctly by supplying some features that ...
1
vote
0answers
28 views

PostGIS. Obtain the rotation between two equal Geometries

I've got two features with the same drawing (poliline) but one is rotated relative to the other. I would like no know in PostGIS the rotation between the two geometries to apply this rotation to a ...
1
vote
0answers
135 views

Problem import shapefile in PostGIS database

I am having a Polygon shape-file. When I try to import this shape-file in PostGIS some of the attributes in Geom Field is found empty. But in attribute table when I select that polygon It is visible ...
1
vote
1answer
471 views

What to do if PostGIS gives error that “geometry requires more points”?

I have a .TAB file. I convert it to ESRI(shp)-->sql and insert it into database. Using PostGIS when I want to convert the data into ESRI file, it shows an error: geometry requires more points ...
1
vote
2answers
473 views

ST_DWithin uses Geometry or Geography type

assuming I use the following query to match the locations to a poi within 10km distance: SELECT poi.poi_id, h.loc_id, (ST_Distance(poi.geom,h.geom)*111.111) as distanceinkm FROM iut_poi_transl AS ...
0
votes
0answers
141 views

several fields and GEOMETRY GetFeatueInfo from Geoserver

Good day!. I have a table in PostGIS 2.0 with several fields of type GEOMETRY. In the geometry_columns they are published in Geoserver 2.2 as layers. This is done as here - geoserver docs, but ...
0
votes
1answer
192 views

ST-Links convert Feature Class to DB Table error

I'm using ArcMap with the ST-Links SpatialKit Conversion tool to convert a Feature Class to a DB Table. But I'm getting an error: ERROR: 42601: type modifier is not allowed for type "geometry". I ...
2
votes
1answer
4k views

Making POINT from longitude/latitude coordinates in existing table using PostGIS?

I would like to make a POINT using the longitude and latitude columns of an existing table. Here's a link to the documentation of ST_MakePoint. Here's my table: CREATE TABLE sysinst.bio ( oid ...
2
votes
1answer
108 views

Which is better for storage? Geometry column or varchar?

Objective: Need to store and retrieve a list of geometries from the database. Basically these are drawn by the user using OpenLayers which I would like to save and present again as a list (kind of ...
4
votes
2answers
356 views

PostGIS algorithm to unite points of two geometries that are within specified radius

I want to find an PostGIS algorithm to unite points of two geometries that are "near" to each other. That is: I want a function, that takes as input two geometries, and returns 1 geometry, that ...
2
votes
1answer
360 views

Geometry valid in PostGIS turns out to be not valid in Oracle

Geometry is in PostgreSQL database. It is valid. Geometry is exported as GML and then inserted into Oracle database. Then function SDO_UTIL.RECTIFY_GEOMETRY(geometry, tolerance) is called, which ...
13
votes
5answers
411 views

What in-depth spatial database systems tutorials exist?

Is there a good tutorial that explains in depth the internals of a GIS and a spatial database system such as PostGIS with examples and without any background assumption? I'm specifically looking for ...
5
votes
1answer
108 views

Should the geometry column always be the last column of a postgis table?

When we need to add an attribute to a table (e.g. a table of 350,000 polygons), my instinct is to always recreate the table so that the geometry column is last. I think this is a best practice for ...
4
votes
2answers
1k views

postgis error: when adding features geometry has z dimension but column does not

I have to define a geometry column in PostGIS for 2D points, but when I try to import points from DXF to postgres I get the following message: "postgis error: when adding features geometry has z ...
2
votes
1answer
2k views

How to fix incorrect SRID of the geometry column? [duplicate]

I've been told to use AddGeometryColumn to properly add a column with correct/preferred SRID. however I wonder if it's possible to fix/change the current column instead of adding a new? If there's no ...
1
vote
2answers
593 views

dealing with 2 different coordination systems in postGIS

I'm seeking a function that converts degrees to the following format: POINT(405115.926025391 4543389.4354248) I dont know this format's name, but is there any function to do so? Cheers, EDIT ...
11
votes
4answers
14k views

How to get coordinates from geometry in PostGIS?

This line: SELECT geom FROM myLayer.geom will return a hex value, i'm wondering how would it be possible to get decimal values, a result that look likes human-readable coordination? Regards,
3
votes
4answers
1k views

What is the easiest way to detect geometry type from text in PostGIS?

I have some records with different types of 'geometries (poly,line,points)' stored as string. I'm trying to use ST_GeomFromText as I want to do some intersection with them. What is the easiest way to ...