0
votes
1answer
34 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 ...
1
vote
1answer
40 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
43 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
164 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
36 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
86 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
127 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
33 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
51 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
89 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
40 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
141 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 ...
1
vote
1answer
198 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
4
votes
3answers
88 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
71 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 ...
7
votes
1answer
223 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
120 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
29 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
77 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
67 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
256 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
64 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
39 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
27 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
122 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 ...
0
votes
0answers
32 views

ERROR: CASE types geomval and geometry cannot be matched

I am trying to optimise the speed of the intersection query that I am running. However, I am struggling to find the best way to do this. And found a similar bit of sql that looks like it would do ...
0
votes
1answer
390 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
419 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
123 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
183 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
3k views

Make POINT from longitude/latitude coordinates from existing table in 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
101 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
329 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
331 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
401 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
106 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
943 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
514 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 ...
8
votes
4answers
11k 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
846 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 ...
3
votes
1answer
178 views

Road layers appearing as points in GeoServer previews - both openlayers and GeoExp

I am wondering why my roads layer keeps appearing as points when previewed inside GeoServer - layer preview using both the OpenLayers and GeoExplorer options. The data are imported from PostGIS. I ...
2
votes
1answer
334 views

Remove stale/obsolete geometry columns from the geometry_columns table

I understand that the function Populate_Geometry_Columns() inserts records in the geometry_columns table for geometry columns that are not yet listed there. However, an invocation of ...
1
vote
0answers
92 views

Calculating spaces between roads from PostGIS database

Is it possible to calculate the spaces between the roads using a select statement in a PostGIS/PostGre Database? I tried using some combinations of the predefined functions as ST_Intersects & ...
1
vote
1answer
517 views

How to add constraints in PostGIS?

I have table that containing road network. Table structure is CREATE TABLE final_all_india_road_network ( gid serial NOT NULL, "name" character varying(254), code character varying(254), ...
3
votes
1answer
214 views

Splitting large PostGIS/GeoServer geometry for WMS optmization

I have a large geometry (MultiPolygon) for a (fictional) world map. It basically spans a large portion of the entire world: it's the difference between a buffered extension of the union of the entire ...
0
votes
1answer
39 views

Requires Datatype for inserting features

I have imported postgis data in geoserver. In geoserver the spatial data column is displayed as MultiLineString, Does it affect when inserting features into geoserver or does it have to be explicitly ...
7
votes
2answers
732 views

Growing a PostGIS geometry by a percentage

I'm looking for a way to add a buffer around a PostGIS geometry, but the size of the buffer should depend on size of the geometry. That is, I want each geometry to be enlargened by, say, 5%. The idea ...
11
votes
2answers
1k views

How to calculate the angle at which two lines intersect in PostGIS?

I want to calculate the angle between two lines where they intersect in PostGIS. The starting point for angle calculations in PostGIS seems to be ST_Azimuth - but that takes points as input. My first ...
6
votes
1answer
2k views

Postgis - Converting 'geometry_dump' data type to a 'geometry' type

I am working with a dataset of property boundaries that has had ST_Union() run on it, thus all the polygons appear as a multi polygon in one row of a table. I would like to separate these out so I get ...