Tag Info

Hot answers tagged

3

Command-line dump straight into psql is the best bet pg_dump -h host1 -t yourtable database1 | psql -d database2 -h host2 The line in the middle is a pipe, it takes the output from the first command and provides it as input to the second.


3

You must first extract the geometries from the JSON before merging them. This should do the trick: WITH source AS( SELECT '{"type": "FeatureCollection", "features": [{ "geometry": {"type": "MultiPolygon" , "coordinates": [[[[-184557.61264043, 384896.54253906], [-134666.391073443, 239616.414560895], [-308616.222736376, 238788.813082666], ...


3

The ST_Split PostGIS function is probably what you want. To get a single line split by multiple points, you could use something like this multipoint wrapper plpgsql function. I've simplified it just to the "split (multi)lines with (multi)points" case below: DROP FUNCTION IF EXISTS split_line_multipoint(input_geom geometry, blade geometry); CREATE FUNCTION ...


2

You probably need to change the pg_hba.conf file to enable for remote connections. Then you need to register the db with ArcGIS server. In ArcGIS server you will go to the Site tab, and choose datastore. Copy your sde connection file to the sever and point to that connection file.


2

The general process is use ST_DUMP to break the geometry into parts. Apply a ST_DIFFERENCE to each part and then collect it back together with ST_COLLECT. I've tested this with PostGIS 2.0.1 SELECT ST_AsGeoJSON(ST_MULTI(ST_COLLECT(d.Geom)))::json FROM ( SELECT ST_DIFFERENCE( (P.Parts).geom, ST_GeometryFromText('POLYGON ((25 75, 75 ...


2

I haven't got a installation of postgis to test this on, but something like the following should work. SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY code ORDER BY ST_Distance(geom, ST_SetSRID(ST_MakePoint(-90,40),4326)) RN FROM Table ) Closest WHERE RN = 1;


2

If you're looking for geojson support, I would go for builtin PostgreSQL capabilities instead of parsing it with PHP. It's available since version 9.3 and it works like charm with Leaflet library. You'd also probably need to do some routing if you want to build a RESTful app and you might find any of these PHP framework handy.


2

I do not know of a Commercial Service, but the US Census Tiger Dataset has a lot of City Boundary information that is current as of 2014. These are supplied as Shape Files which could be loaded into a PostGres/PostGIS database You would need to implement a Reverse GeoCode Lookup (this is a link to Google's service) to obtain a Latitude/Longitude for the ...


2

Since you're not worried about simultaneous edits on features, I'd say that in theory you have nothing to worry about. The main danger w/ QGIS is that simultaneous editors can stomp on each other's edits without noticing ("last edit wins"). For data under active editing with multiple users you might want to at least keep track of history, which you can do ...


1

I did some development a couple of years ago for a company called Avalara that provides commercial services (built on MapDotNet) for obtaining just that sort of information about tax jurisdictions for a given location by address or by coordinates.


1

Eventually I have figured out how to add SFCGAL functions to a PostGIS db. According to my research, one cannot configure SFCGAL to an existing PostGIS installation. The best approach for me was to reinstall PostGIS with SFCGAL configuration. Install SFCGAL. You may need to install prerequisites from terminal like sudo apt-get install cmake libcgal-dev. ...


1

The problem is that you need the package libpq-dev installed. try this: yum install libpq-dev


1

If you plan to use Mapserver and PostGIS, you may edit the spatial database using WFS-T provided by TinyOWS add-on: link to the docs There is also a project called dirt-simple-postgis-http-api (former PostGIS RESTful Web Service Framework), but it's read-only. For full CRUD capabilities, you will have to create a backend service from scratch. ...


1

In order to close a linestring, the first and last binary coordinates (i.e. WKB) need to be exactly equal. WKT cannot be relied on, since it is rounded/truncated to be misinterpreted by humans. While the start and end points for the example problem have the same WKT, they do not have the same WKB, and thus the linestring is not exactly closed, even when the ...


1

You can get attribute information by simply adding this control. new OpenLayers.Control.WMSGetFeatureInfo({ autoActivate: true, infoFormat: "application/vnd.ogc.gml", maxFeatures: 5, eventListeners: { "getfeatureinfo": function(e) { var items = []; Ext.each(e.features, function(feature) { items.push({ ...


1

You have such a tool in your GeoServer layer preview OpenLayers app. It creates GetFeatureInfo request when you click at your map. It does not make a popup but shows info below the map. The Openlayers control is here http://dev.openlayers.org/docs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html and a demo is here ...


1

2 ways: By creating trigger functions for your data tables, which insert "update timestamps" into an update_log table. See this If you want to find out the historical update time for a table, the manual method is to find the file node name from the pg_class for your table select relfilenode from pg_class where relname = 'tablename' Locate the ...


1

Use st_dwithin. It will use the spatial index and do the job very fast if it is only points. 500 000 points is not that much.


1

If you want a GUI for pgRouting, you can install the pgRoutingLayer plugin for QGIS. It provides a GUI to access pgRouting functions to compute routes. The routes can be displayed and exported to QGIS layers which you can manipulate and analyze any way you want. You can see the plugin in action in the following screenshot (panel on the right). The plugin ...


1

Leaving out name seems no good idea. Not every object in Germany has a name:de tag. I would keep landuse to get the residential and industrial areas. access would be nice to filter out private ways.


1

I finally figured that the culprit was my scipy installation and its incompatibilities with the numpy inlcuded with arcpy, etc. Solution: a repair put everything back in order and database connections work perfect. Now my problem is to find a working 64-bit numpy-scipy stack that does plays well with ArcGIS. For 32-bit, the official 32-bit release from here ...


1

It appears to have been a different root cause (the above issue was resolved via permissions), but I ran into the same error when importing to PostGIS with ogr2ogr: ERROR 1: Terminating translation prematurely after failed translation of layer mybeautifulshapefile (use -skipfailures to skip errors) In my case it was a lingering shapefile (TIGER census ...


1

Best I could find by briefly looking at the PostGIS code was, that these kind of exceptions are raised by GEOS. So I would recommend you to look at their wiki, sources etc. like http://trac.osgeo.org/geos/wiki/TopologyExceptions



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