Tag Info

Hot answers tagged

6

First, install the psycopg2 package, a Pythonic interface for PostgreSQL. Then, use ST_MakePoint: >>> import psycopg2 >>> conn = psycopg2.connect(dbname=..., port=..., user=..., password=..., host=...) >>> x, y, z, = 32, 34, 0 >>> cur.execute("SELECT ST_SetSRID(ST_MakePoint(%s, %s, ...


3

You can use ogr2ogr with the -sql option to use a sql statement


3

You can use ST_DumpPoints to get the points and then ST_AsLatLonText to get nicely readable coordinate output. It doesn't care if the geometries are multi* or not. Alternatively, you could use ST_Boundary to get the polygon vertices, but you'd need to use ST_Dump first for this to work for multipolygons too.


2

You probably should just create a new column and I would suggest if you are new to PostGIS, you probably want to use geography instead of geometry. So somethng like ALTER TABLE m_copy ADD COLUMN geog geography(POINT,4326); UPDATE m_copy SET geog = ST_SetSRID(ST_Point(longitude,latitude),4326)::geography; If you decide to use geometry, just replace the ...


2

The only way I could get POSTGis on "Trusty" was to build from Sources, here is what I used .. sudo mkdir postgis-build cd postgis-build ------------------------------------------------------ then put the script below in a shell script file sudo nano build.sh make it executable and run it sudo chmod a+x build.sh ...


1

This isn't covered by the functionality of most webmap toolkits. Instead this is realized by the renderers who create the basemap that is embedded with Leaflet. Thus, you need to setup Mapnik, Maperitive, Mapbox, ... create a mapstyle that you want and deliver it to your endusers. Otherwise you might want to adapt existing style e.g. delivered by Cloudmade, ...


1

1) You seem to have a mix of projections in your original files (shapes) so, How are you loading the files to Postgis? Specifically, What projection are you passing as a parameter to shp2pgsql? because if I remember correctly, if you don't specify a srid then Postgis assumes it to be in local coordinates (srid 0) and planar units so that maybe why you're ...


1

This doesn't answer your question directly - Mapperz has probably pointed you in the right direction. But I recommend using the UbuntuGIS package(s) as they've proven to be e-a-s-y to install and all the dependencies are there. # UbuntuGIS package: sudo apt-add-repository ppa:ubuntugis/ppa sudo apt-get update #or for bleeding edge: sudo ...


1

First, use https://mapzen.com/metro-extracts/ for more up to date data. Second, you seem to be loading a raw osm file, and not a shapefile. Please try the same with "osm2pgsql shp" or "imposm shp" file for your region.


1

Depending on how confident you are with technical setups, rather than running local GeoServers, you could use something like TileMill to generate MBTiles files of all your images, or just the images using Invar. This can then be show by simple python code like TileStache. This would be a much lighter weight setup.



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