1
vote
2answers
42 views

PostGIS to GeoJSON with GDAL: how to get lat/longs?

I'm trying to convert line features from PostGIS to GeoJSON files, as follows: from psycopg2 import * from subprocess import call conn = connect(dbname='gis') cur=conn.cursor() cur.execute("SELECT ...
1
vote
0answers
37 views

django---error in displaying data and displaying it on the map

. i am trying to display a feature queried from postgis. . i also designed a user input field to enter the id of the desired feature to be displayed. . i have already queried the attributes first ...
2
votes
1answer
89 views

Transform projection from EPSG:4326 into EPSG:900913

. i've got this problem about projection. .i just wanted to know what am i missing. . i already displayed map base layer using openlayers through base_layer = new OpenLayers.Layer.WMS( "OpenLayers ...
1
vote
1answer
49 views

PostGIS convert GeoJSON to geography

While there are functions to convert geography to GeoJSON: text ST_AsGeoJSON(geography geog, integer maxdecimaldigits=15, integer options=0); I do not see any way to go the opposite direction ...
0
votes
0answers
159 views

Java + GMaps JSF + PostGis + JasonSanford / geojson-google-maps

Guys want to test how to plot lines and points in google maps using Java + JSF + PostGIS + GMaps JasonSanford / GeoJSON-google-maps. First have a spaceport in postgis with a table of rows and other ...
2
votes
3answers
82 views

How to get a bbox selection of huge shapefile as GeoJSON?

I have a 4.29 GB Shapefile from which I want to extract features as GeoJSON, defined by a bounding box. This should be as fast as possible, because I want to use it in a web application. My first ...
1
vote
1answer
44 views

How to limit decimal digit of GeoJSON

I am using postGIS. I am using ST_AsGeoJSON(geom) function to get GeoJSON data of Geom field. Its returning a long lat value that have 13 digits after decimal point. Is there any way to reduce or ...
0
votes
3answers
113 views

Postgis ST_AsGeoJSON() to openlayers security issues?

Im about to implement a python script serving my openlayers code with GeoJson data from PostGIS. However, here How to connect OpenLayers to PostGIS data? I see " Unfortunately you cannot connect a web ...
3
votes
2answers
167 views

How to generate one geojson file from several rows in Postgres/PostGIS?

I have a table with geospatial objects, in particular, polygons. I know that I can generate from one row a geoJSON string using ST_AsGeoJSON(http://www.postgis.org/docs/ST_AsGeoJSON.html). But I would ...
3
votes
2answers
188 views

Is it possible to check incoming GeoJSON to see if any of the features are identical to existing ones before adding to map?

I am working on a Rails/PostGIS app and doing a typical ajax call to retrieve GeoJSON within the map viewport bounds. Whenever the map is shifted or zoomed all of the markers are removed and then ...
0
votes
2answers
218 views

PHP PostGIS to geoJSON missing required parametar error

I'm using this PHP PostGIS to geoJSON script: https://gist.github.com/bmcbride/1913855 But I keep getting this error: 'missing required parameter: geotable' This is my code: # Retrive URL ...
1
vote
2answers
200 views

Can't read returned geojson

I've got a function that takes an Openlayers mouse click and puts the click location into a SQL statement which then gets passed to a JSP script which runs the SQL statement on the PostGIS database ...
-2
votes
1answer
55 views

Render specific vector data from database with openlayer

I want to render some data on a map. They are stored as points in my database (postGiS), each one is associated with a name. I want to render points with the same place name in the same color. ...
3
votes
2answers
1k views

Is there any efficient way to convert Geojson to WKT?

I want to use ST_GeomFromText() to load vector data to PostGIS. However, I don't know how to convert from Geojson type to WKT. N.B. I know I can use OGR2OGR to upload the geojson directly, but I just ...
0
votes
1answer
319 views

PostGIS error reads “Geometry has Z dimension but column does not” [duplicate]

I try to store a polygon in GeoJSON format into my PostGIS table. Both are using the CRS EPSG:3857. This is how the polygon is defined. Note that I put in some whitespace to make it more readable. { ...
6
votes
3answers
2k views

How to insert a GeoJSON polygon into a PostGIS table?

I need to insert a polygon from GeoJSON to my PostGIS table. This is how the SQL query looks like. INSERT INTO tablename (name, polygon) VALUES ( 'Name', ST_GeomFromGeoJSON ( { ...
2
votes
3answers
707 views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
1
vote
1answer
156 views

SQL Command to convert pgRouting result to GeoJSON

My goal is to produce a Web UI for pgRouting using this tutorial. I have already imported my data from an OSM pBF to PostGIS using osm2po. Using the pgRoutingLayer plugin for QGIS, I was able to ...
2
votes
1answer
586 views

Spatial Data from Postgis to Java/REST with RestEasy + Jackson

I'm developing an application where I take a route from google maps, save it in postgresql/postgis. I'd like to take this route (LineString geometry) and send it back to Google Maps. I already can ...
1
vote
2answers
722 views

How to project a geoJSON file in OpenLayers?

I have a json file well formed. I want to read a json file as a base layer from OpenLayers. <script type="text/javascript"> var styles = new OpenLayers.StyleMap({ ...
1
vote
2answers
261 views

Polygon intersection with bounding box with polygon's holes intact

I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building ...
2
votes
1answer
423 views

formatting geojson from postgis data using node.js

I am trying to build a GeoJSON object from a SQL query to some GIS point data in a postgis postgresql database. A snippet of my node.js app.js is below. As it stands I understand building the type ...
1
vote
0answers
668 views

searching GeoJSON features

After googling for many days and reading the OL documentation, I don't understand well how the filterToParams in OpenLayers.HTTP protocol should work, what I'm trying to do is to find and display the ...
4
votes
2answers
1k views

Beginner needs suggestions on map clicks and geojson

I'm a beginner with programming, and javascript. I went to the FOSS4G-NA conference and was very inspired to learn more. I'm trying to learn PostGIS, and have come across a very useful tutorial for ...
1
vote
0answers
44 views

How to load GeoJSON files directly onto QGIS? [duplicate]

Possible Duplicate: Plugin or script to get QGIS to display geoJSON in a layer Is there a way to do this? Or is there a way i can put it onto PostGIS and then load it onto QGIS? I actually ...
2
votes
3answers
485 views

How to create a efficent linestring out of geography points using postgis

I'm trying to create a linestring out of geography points. At the moment I'm doing it like this: select ST_GeographyFromText(ST_Makeline(a.record_point)) from ( select (record_point::geometry) from ...
9
votes
4answers
1k views

Alternatives to ogr2ogr for loading large GeoJson file(s) to PostGIS

I have a 7GB GeoJson file that I would like to load into a PostGIS database. I have tried using ogr2ogr but it fails because the file is too big for ogr2ogr to load into memory and then process. ...
10
votes
2answers
2k views

How to Export Feature GeoJSON from PostGIS

I'd like to do a GeoJSON dump of a PostGIS table, but I want to export features (the geometry and the properties) not just the geometry. I've been digging into the ST_AsGeoJSON function but it looks ...