1
vote
3answers
99 views

How to export streets in a certain area from one shapefile to a new shapefile?

I have a shapefile with the roads from Europe and I want to export in a new shapefile only the roads from Greece. I tried to delete the other roads but there are too many and I have no attribute to ...
0
votes
3answers
162 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
3
votes
2answers
220 views

Importing .shp to postgreSQL

I want to import a shp file to postgreSQL. First I create sql file and then run PostgreSQL. To create sql file, I run this command in windows cmd: shp2pgsql -s 4326 worldCountries.shp worldcountries ...
1
vote
1answer
54 views

Postgres/PostGIS: Dissolve multiple fields with COUNT (Point shape)

I have loaded point .shp feature classes into Postgres 9.3 db, and enabled postgis,plpgsql,postgis_topology extensions. I'm looking to dissolve multiple fields within a single table 'TABLE1' and add ...
2
votes
1answer
80 views

How to use pgsql2shp when PostGIS extensions installed in a separate schema as geometry

I have the PostGIS extension (postgis functions and spatial_ref_sys table) added to a specific schema called postgis. I'm wanting to run the pgsql2shp utility with a select query on geometries stored ...
2
votes
3answers
146 views

How to rename PostgreSQL/PostGIS columns while importing Shapefiles?

I discovered shp2psql to successfully import geospatial data from ESRI Shapefiles into PostgreSQL/PostGIS. Now I would like to automatically rename the target column names. Is there any mechanism ...
3
votes
1answer
128 views

Debugging ogr2ogr “AddGeometryColumn failed” and “Terminating translation prematurely after failed translation of layer”

As noted in the title, I'm getting the following error: ERROR 1: AddGeometryColumn failed for layer pretty_polys, layer creation has failed. ERROR 1: Terminating translation prematurely after failed ...
0
votes
2answers
57 views

How to update postgis layer from shapefile in QGIS?

My usual workflow with updating layer from shapefile was to: Open DB Manager; Load SHP files into QGIS; Open DB Manager; Import file (with drop option). Now my problem is that I have created ...
1
vote
1answer
55 views

shape file into DataSet in postGIS using openJUMP, but getting error

I am new to this field and I want to save my shape file into DataSet in postGIS using openJUMP, but I'm getting an error...can anybody tell me solution for this?
0
votes
0answers
36 views

How do I break up a shape file into contiguous area?

I've got a shapefile which is a union of non-contiguous shapes. I'd like to be able to break them up into individual groups. For example, suppose I have a polygon of the entire US, currently only ...
0
votes
1answer
53 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
32 views

shp2pgsql data appent without gid

I have a shape file, I opened it in QGIS that has columns in attribute table named CITY_NAME, POPULATION and I have a database table in Posqgresql that has columns named gid (primary key), ...
0
votes
0answers
58 views

PGSQL2SHP Commnad switch column type

I work with Postgis. I have table CREATE TABLE centerline ( gid serial NOT NULL, l_from integer, l_to integer, r_add_pre character varying(15), r_to integer ... } Export this table with ...
0
votes
1answer
40 views

How can i store shape file in postgress database as a table using php?

I want to create a table from a shape file in Postgres. To do that, I can run this command in cmd: shp2pgsql -s 4326 -W LATIN1 E:\Any\THA_adm public.test123 | psql -h localhost -d DATA -U postgres -w ...
14
votes
1answer
356 views

How to query OSM for all beaches facing west? - QGIS preferred

I want to identify all beaches on this planet (or a given subset of it) that are facing westwards (+/- 20-30 degrees). My idea is to use OSM as the data source. Extracting all polygons that have the ...
0
votes
2answers
78 views

QGIS Connection PostGIS and shapefile

I'm working on QGIS with a database created in PostGIS and a shapefile. Inside the database, I have geometry type data about location of some points, instead on the shapefile there some selected ...
2
votes
1answer
108 views

Update postgres/postgis point data attribute from another enclosed polygon shapefile in QGIS

I have a placename point table in postgis with 'district' column. a districts polygon shapefile with district name in 'Name' column. See the image below. I would like to update the 'district' ...
3
votes
1answer
267 views

Importing multiple shapefiles into single PostGIS table

I have a folder full of shapefiles that I want to import into a single PostGIS table. This table should have the following columns: id, filename, multipolygon I can bulk import all shapefiles using ...
0
votes
1answer
106 views

How to display data from multiple layers in OpenLayers? [closed]

I am new to using openlayers and Geoserver. I currently have a few shapefiles of a place with a background map of that place. I have imported both shapefiles into postgresql and geoserver. After ...
0
votes
2answers
174 views

Problem Importing shapefile into postgresql with simple geometries

I have a Line Type shapefiles to be imported to postgis database on my postgresql, I'm using the SHP loader, I checked the "Generate simple geometries instead of MULTI Geometries" options so that the ...
2
votes
2answers
92 views

shp2pgsql mangles date field — quotes data as if it were char or varchar

I'm attempting to import a shapefile into postgis via shp2pgsql. Among the fields in the shapefile's .dbf file is a date field with format yyyymmdd, which is a valid date format for postgresql. ...
1
vote
2answers
68 views

Ogr2ogr - shape to postgis - is there a way to use and preserve an existing primary key?

I've been struggling with this for a while, tried a few different ideas inspired by these pages: http://www.gdal.org/ogr2ogr.html http://www.gdal.org/ogr/drv_pg.html ...
1
vote
1answer
125 views

Load partial shapefile into Postgis / GeoDjango project

I have a shapefile with Canadian postal codes, but am only looking to load a small subset of the data. I can load the entire data file and use SQL or Django queries to prune the data, but the load ...
2
votes
3answers
1k views

Postgis shapefile loader 2.1 error: dbf file can not be opened

The .shp, .dbf and the rest of files are fine, I open them in QGIS, AGOL with no problem. In fact, I've tried 3 different layers, and get always the same error. Anyone can please help, as I really ...
1
vote
0answers
43 views

How to load or query data directly to R from a PostGIS database using RPostgreSQL and rgdal [duplicate]

Is it possible to load/query a shapefile to R, which is stored in a postgres/postgis database? I've built up a connection to my postgres database via DBI, RPostgreSQL and I want to make some ...
0
votes
2answers
325 views

How to convert shp to PostGIS dump?

Given a file my_file.shp such those from Gadm e.g. US administrative divisions, where the coordinate reference system is latitude/longitude with WGS84 datum. Input could actually be: Shapefile, ...
5
votes
1answer
202 views

Maritime route prediction avoiding land masses

I am working on a project where the following functions have to be implemented: Predicting the locations of the ships (in maritime environment) at a future time. (Can be done with Kalman filter, IMM ...
2
votes
0answers
144 views

Hitting Memory Limits of PostGIS ST_ConcaveHull / Incomplete Shrink Wrap

I am trying to use PostGIS 2.0 on Postgres 8.4 to do some mapping. I am working with the NOAA Shapefiles, specifically their US States & Territories file located here: ...
6
votes
1answer
248 views

Importing a shapefile into Postgres: Can I use Multiple CPU Cores?

I'm importing some shapefiles into Postgres/PostGIS. I'm using Windows 8 and the shapefile importer/exporter GUI. It maxes out one CPU core. I'm wondering if there is a way I can use multiple cores ...
2
votes
2answers
2k views

Install the Pgadmin3 shapefile importer plugin on a Mac(10.8)?

I'm new to GIS related things and I'm setting up a Postgre/Postgis database for geospatial queries. I'd like to import various shapefiles into the database and I found that Pgadmin3 has a shapefile ...
1
vote
1answer
114 views

Postgis invalid geometry from shape file

I'm having trouble converting a Feature class (shape file) to a DB table (Postgresql 8.4/Postgis 1.5). This is the command in the pg log: INSERT INTO "public"."distritos" ("Shape" , "DEPARTAMEN" , ...
2
votes
1answer
289 views

Force dimensionality with shp2pgsql

After invoking: shp2pgsql -W "latin1" theshape.shp > thesql.sql My console responds with: Shapefile type: PolygonZ Postgis type: MULTIPOLYGON[2] Note the shapefile type is PolygonZ. The result ...
-1
votes
1answer
124 views

Shp2pgsql - exec() not allowed on external server

Me and my collegue are using the shp2pgsql and psql commands in php code (a Drupal module to be precise). We put these commands in a php variable and use the exec() command to execute them. This ...
0
votes
1answer
475 views

Unable to load Shapefile using pgShapeloader / shp2pgsql-gui (pgAdmin3's PostGIS Shapefile Import/Export Tool)

I am trying to load a shapefile (http://dds.cr.usgs.gov/pub/data/nationalatlas/statesp020_nt00032.tar.gz) into PostGIS 2.0.1 using pgAdmin3's PostGIS Shapefile Import/Export Tool. However its not ...
5
votes
3answers
387 views

Adding a GIS feature to existing database entry with QGIS

I've built a database with postgreSQL with tables, which include geometry columns. When I add some data to my non-geometry columns, I can see them in QGIS when I connect to my database using postgis. ...
4
votes
2answers
245 views

Shapefile postgis database to be queried by GeoDjango

I would like to create a Postgres database (postgreslq-9.1 and postgis-2.0.2) storing several shapefiles but I am uncertain on how to implement it so I'm searching for some advices. I have already ...
6
votes
3answers
215 views

Are there any open source Python modules compatible with arcpy that will allow complex SQL queries?

I am trying to handle string (non-geometry) duplicates in a large attribute table of a shapefile without having to convert to gdb and back or connect to a postgres db. I need to be able to use a count ...
1
vote
2answers
222 views

How to remove shapefile from PostGIS

I added a shapefile to the PostGIS using, ogr2ogr -f PostgreSQL PG:"host=server_ip user=username dbname=dbname password=password" yourshapefile.shp; Now I want to remove it. What is the command ...
8
votes
2answers
7k views

Adding shapefiles to PostGIS database

I was able to create a Postgresql database and then I executed, createlang plpgsql geospecies psql -d geospecies -f postgis.sql psql -d geospecies -f spatial_ref_sys.sql So now can I directly ...
1
vote
0answers
102 views

I've converted a kml to shp and want to import it to pgsql database, but no geometry column [closed]

As the title explains, I have a shapefile whose attribute table has no geometry column specifying the location of points. Rendered in QGIS, it looks fine, so the geometry data is obviously there. ...
9
votes
5answers
2k views

How can I update ogr2ogr to include the PostgreSQL driver?

I'm trying to use ogr2ogr to upload a shapefile to a remote PostGres installation. When I ran this command: celenius:~ celenius$ ogr2ogr -f PostgreSQL PG:"host=255.34.00.00 user=postgres dbname=mydb ...
0
votes
1answer
228 views

one row is discarded while importing shapefile into postgres

Please help me in following issue. I need to import a polyline shapefile into Postgres9.1 through shp2pgsql command.When i did like this, i got an error as "NOTICE: CREATE TABLE will create ...
5
votes
2answers
894 views

Loading data onto PostGIS using KML files with attibute data

So, I have a kml file which contains 317 data points (317 polygons and the respective 317 names). The kml file also contains attribute data which pops up in a bubble on Google earth with about 12 ...
3
votes
2answers
952 views

Convert KML to shapefile without losing attribute data

So I want to convert KML files to SHP shapefiles to load it onto PostGIS. Currently I'm using ogr2ogr to do the conversion for me, but it wipes out all the attribute data. How do i preserve this ...
3
votes
2answers
3k views

Import Shapefile to Postgres

I am trying to import a shapefile to Postgres using the following: shp2pgsql c:\location\water_areas.shp water > water.sql I am receiving the following message: c:\location\water_areas.shp: ...
2
votes
1answer
350 views

Error while importing shapefile using shp2pgsql: Coordinate values are out of range

I have a shapefile with 180 points. I'm using shp2pgsql-gui via pgAdminIII. This is an error it gives me when I try to import shapefile. Failed in pgui_exec(): ERROR: Coordinate values are out of ...
6
votes
3answers
2k views

How to load OSM data into PostGIS preserving all Tags?

I am new to the field of GIS and am trying to view source tags in OSM. I have downloaded the shapefiles from http://downloads.cloudmade.com and have loaded them into Postgres. When I view the data, I ...
12
votes
3answers
922 views

Centralizing shapefile data into database

I've got hundreds of shapefiles from various different GIS projects that I want to start consolidating into a single database platform, currently attempting this with Postgres / PostGIS. Hardly any ...