I'm try to display my points set from Geoserver in Openlayers map. I want to use WFS service, but at the moment I see one point, additionally in wrong place!  I want to display all at EPSG 4326. I transformed map to this coordinate system and my points on Geoserver (imported from PostGIS database) are at EPSG 4326. I use Geoserver 2.15.1.  My code:   var wfs = new ol.layer.Vector({     source: new ol.source.Vector({         loader: function (extent) {             $.ajax('http://localhost:8080/geoserver/pilgrimages/ows', {                 type: 'GET',                 data: {                     service: 'WFS',                     version: '1.1.0',                     request: 'GetFeature',                     typename: 'travels',                     srsname: 'EPSG:4326',                     outputFormat: 'application/json',                     bbox: extent.join(',') + ',EPSG:4326'                 }             }).done(function (response) {                 wfs                 .getSource()                 .addFeatures(new ol.format.GeoJSON()                   .readFeatures(response));             });         },         strategy: ol.loadingstrategy.bbox,         projection: 'EPSG:4326'     }) });  var map = new ol.Map({     target: 'map',     layers: [         new ol.layer.Tile({         source: new ol.source.OSM()         }),         wfs     ],     view: new ol.View({         center: ol.proj.transform([0,0], 'EPSG:4326', 'EPSG:3857'),         zoom: 6     }) });    Can you help me?
89649
I have to display a layer from a WFS service () using OpenLayers 3.x API (..there's a reason). The WFS service is exposed in .  In similar cases I have always used the following code successfully:  var sourceWFS = new ol.source.Vector({     loader: function (extent) {         $.ajax('http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/Bacini_idrografici.map', {             type: 'GET',             data: {                 service: 'WFS',                 version: '1.1.0',                 request: 'GetFeature',                 typename: 'ID.ACQUEFISICHE.BACINIIDROGRAFICI.PRINCIPALI',                 srsname: 'EPSG:4326',                 bbox: extent.join(',') + ',EPSG:4326'             }         }).done(loadFeatures)         .fail(function () {         alert("error loading vector layer");         });     },     strategy: ol.loadingstrategy.bbox, });  function loadFeatures(response) { var formatWFS = new ol.format.WFS();   sourceWFS.addFeatures(formatWFS.readFeatures(response)); }  var vectorLayerWFS = new ol.layer.Vector({   source: sourceWFS, });   But now, this layer WFS isn't displayed on the map and I do not understand why?  What's wrong?
49882
I want to overlay some data whose projection is WGS-84 on Google map layer in OpenLayers. But I just can't make them in the right place. I did as follows:  map = new OpenLayers.Map('map', {                    numZoomLevels: 20,         projection: new OpenLayers.Projection("EPSG:900913"),         displayProjection: new OpenLayers.Projection("EPSG: 4326")         }); googlelayer = new OpenLayers.Layer.Google("Google street", {sphericalMercator: true}); map.addLayer(googlelayer); veclayer = new OpenLayers.Layer.Vector("vector", {                                     projection: map.displayProjection                                     }; var geojson_format = new OpenLayers.Format.GeoJSON(); veclayer.addFeatures(geojson_format.read(jsonData));   Though I have assigned veclayer in 4326 projection, but it is still interpreted as 900913, and the display coordination system is also 900913, though I set displayProjection to 4326. What mistake do I make?
72125
Excuse me if this is a stupid question, but I've honestly tried to find the answer in a few threads here on SE, and I cannot seem to follow the suggested steps correctly.    Project is in  (WGS 84 / Pseudo-Mercator) BaseMap (OpenStreetMap) layer is set to EPSG:3857 Vector data has been imported from CSV, and has Lat/Long coordinates, set to EPSG:3857.    The layer appears right in the middle of the map, around 0,0 obviously.   Why is this, what am I doing wrong?
91633
I have a shapefile and I loaded it into QGIS using Add vector layer. After that, I can see points in different positions. I open the Attribute table and I can see columns &quot;X&quot; and &quot;Y&quot; with values such as (151449.965057, 204642.790761). Now I want to convert them to latitude and longitude. How can I do that? Therefore, I use the option Save as to export the data to csv format using the CRS WGS 84. However, nothing changes in the CSV file (&quot;X&quot; and &quot;Y&quot; stay the same as the original data).  I read and tried several suggestions from this forum without help, e.g., .
11841
I'm trying to convert Shapefiles from the  website into a GeoJSON file for use with Google Maps API. I'm using QGIS to facilitate but I can't get the projection/coordinates right. So far I've tried Google Mercator (EPSG:900913) and WGS 84 (EPSG:4326) with no luck. I'm using the OpenLayers to verify results and it keeps placing Texas near the  Gulf of Guinea (0 lat, 0 lng).
94929
I'm developing a GIS application with java Spring Framework and GeoTools library. I have some vector layer. I want to get this layers with wms and wfs protocols. I've downloaded geoserver code. It includes module as bellow:   Main Module Core Platform Module Web Map Service Module Web Feature Service Module and etc.   Can I use Web Map Service Module and Web Feature Service Module of Geoserver in my project? If yes, How? I want a sample code to use these modules apart from geoserver. Help me please.
122252
I am new to GeoJSON. I have a GeoJSON features collection as shown and would like to store it in postgres table (testtable). My postgres table has a serial id and geometry column.  {     "type": "FeatureCollection",     "features": [         {             "type": "Feature",             "geometry": {                 "type": "Point",                 "coordinates": [                     2565453.1826721914,                     -3835048.659760314                 ]             }         },         {             "type": "Feature",             "geometry": {                 "type": "LineString",                 "coordinates": [                     [                         2727584.7219710173,                         -3713449.1942418693                     ],                     [                         2732476.691781269,                         -3992291.473426192                     ]                 ]             }         },         {             "type": "Feature",             "geometry": {                 "type": "Polygon",                 "coordinates": [                     [                         [                             2442627.9025405287,                             -3705499.954308534                         ],                         [                             2425506.008204649,                             -3886502.837287831                         ],                         [                             2425506.008204649,                             -3886502.837287831                         ],                         [                             2555143.2081763083,                             -3910962.686339088                         ],                         [                             2442627.9025405287,                             -3705499.954308534                         ]                     ]                 ]             }         }     ] }   I would like to insert the GeoJSON data into the table testtable.   How do I go about it?  I am using postgres version 9.3.5 with postgis version 2.1.3    I have been directed to previously asked questions which answer how to store a single feature eg a point or polygon. My question asks how to save multiple features in the GeoJSON file. By multiple features I mean a mixture of points, lines and polygon feature types in one file.
86773
I have a vector image in SVG format. (without georeferences)    I am trying to display it using OpenLayers to display properties of different polygons in it.  I tried converting it to GeoJSON but the resulting render appears to be stretched (ratios are not preserved).  Is there a transformation or a map projection that I am missing or recreating a GeoJSON from scratch the only relevant choice?
119456
I asked this question once before, but I did not receive any feedback on solving on the issue and I am still confused as to what I am doing wrong.  I found a public domain map of Florida counties on Google. All I want to do is add coordinate points from a cvs file to the map. It should be simple, right? Apparently not. I made a cvs file with latitude/ longitude and x,y coordinates, but the points do not line up with the map. Yes, I DID have the same projection for both layers. The counties map had a projection of EPSG 2237, NAD 83/ Florida West (ftUS), so I changed the cvs file to have that same exact projection. I also made negative values for the longitude coordinates for United States. I tried this with various Florida maps to see if the counties map I found was just wrong, but every map I tried had the same issue. I tried various types of x and y coordinates for the points, and nothing was better. This really should be a simple thing to do, so I really would like to know what I'm doing wrong.
5760
I'm new to Geoserver, Ubuntu and Java, but have downloaded a virtual machine from gisvm.com and am getting up to speed. I got as far as configuring it with some fairly large shapefiles from a project I've worked on previously.  My question is related to a problem which I see if I show the shapefile using the OpenLayers layer preview option. I see an error:     OpenLayers map preview code="internalError" Rendering process failed.   java.lang.OutOfMemoryError: Java heap space   Googling has led me to plenty of Java command line options to increase heap space, but I have no idea if this should be applied to an environment variable, in a startup script or as a part of the Geoserver config.   Can you help me to understand what I need to edit to get this working?   I'm also wondering if I should be splitting my shapefile into smaller pieces.
100471
I am calling in some WMS layers using OpenLayers. One of the layers is a raster. I have it working fine. But how does this fit into the spatial database model? I thought a WMS is a protocol for handling vector data. How raster data stored? Are they within PostGIS? Does GeoServer handle raster data?
95487
I have 2D dataset on a layer (currently to British National Grid co-ordinates) and I'm trying to save it as a geojson file using WGS84 CRS and QGIS 3.10.10. This dataset needs to be transformed from the old model OSTN02 to the new OSTN15. Otherwise when I upload this dataset into a geoserver the data is offset. Also when using the WMS layer (basemap - Road 27700) from the Ordenance survey in QGIS is not displaying the data with new model OSTN15. Does anyone know why is this happening? What are the steps to do this transformation or is it just saving the layer, choosing OSTN15 CRS option, which I can't really see?
111248
I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver and PostGIS.  Then I found , which looks pretty new but has the features of connectivity with the Geoserver and PostGIS.  So my project details are as follows,   Use the map interface to fetch Feature Info Create a customized tool that takes the lat/lon from user as to where he/she clicks on the map and then fetches the Climate Data from the raster (which is handled by a py script on the server) Allows user to upload excel, which is sent to the py script, which returns a GeoJSON, which creates Vector Features on the map Allow user to create vector polygons, which will fetch the Features it intersects from the WFS Layer. Fetches Layer from the PostGIS Datastore on GeoServer and displays the layers on the map.   So now I am confused on which is better and why using OpenLayers over Leaflet makes more sense or not?
38122
WMS and WFS queries needs SRS and BBOX parameters.  http://example.com/geoserver/wfs?   service=WFS&amp;   version=2.0.0&amp;   request=GetFeature&amp;   typeNames=namespace:featuretype&amp;   srsName=CRS&amp;   bbox=a1,b1,a2,b2&amp;   For example I have GeoServer to publish WFS. My data SRS is EPSG:4326 and my map SRS is EPSG:3857. So I send a WFS query.  http://example.com/geoserver/wfs?   service=WFS&amp;   version=2.0.0&amp;   request=GetFeature&amp;   typeNames=namespace:featuretype&amp;   srsName=EPSG:3857&amp;   bbox=978393.9621,2680799.4560,-430493.3433,3326539.4710&amp;   Does GeoServer or ArcGIS server give an error? Because my data has EPSG:4326 . Or does GeoServer convert these coordinates internally and find data and send me as EPSG:3857
28286
I used osm2pgsql to import data into my PostgreSQL database and it put gave me the following 4 tables, planet_osm_point, planet_osm_line, planet_osm_polygon and planet_osm_roads.   I have looked at the schema for osm2pgsql and inside the planet_osm_point table there is a column 'way' of type point. I tried to query it as an array like it says in the documentation here ():     It is possible to access the two component numbers of a point as   though the point were an array with indexes 0 and 1. For example, if   t.p is a point column then SELECT p[0] FROM t retrieves the X   coordinate and UPDATE t SET p[1] = ... changes the Y coordinate. In   the same way, a value of type box or lseg can be treated as an array   of two point values.   Anyone know the correct query the planet_osm tables from osm2pgsql based on long/lat? For example if I wanted to retrieve the information for Big Ben (London) I would query along the lines of:      SELECT * FROM planet_osm_point      WHERE ST_Y(ST_Transform(way, 4326)) = '-0.12'        AND ST_X(ST_Transform(way, 4326)) = '51.5';   There is no error message, it comes out with the table names, but no data is output either. (Its an empty table). What am I doing wrong here?  Perhaps it is too precise, i.e. there are no coordinates that match it exactly? Perhaps I need to try being more general, say 51 &lt; long &lt; 52 and -0.5 &lt; lat &lt; 0. Although this would throw back multiple results so would not be quite as accurate.
44093
Using OpenLayers, I added a WFS layer (on GeoServer) with a filter that returns all features (black) that intersect my polygon (yellow) placed over some Latin American countries within certain dates.    However, the feature that crosses horizontally across the map does NOT actually intersect my polygon. This feature is somewhere in the pacific ocean between Hawaii and Fiji and NOT in Latin America. The problem is that instead of crossing the International Date Line it is being rendered on the map by wrapping around the whole world.  The problamatic feature is defined:     POLYGON((-179.700417   14.202717,-178.687422 13.992875,179.024138 8.24716,-179.98241 8.035567,-179.700417 14.202717))   I have many of problematic date line features like this but have narrowed it down to this one for this example. I can't just ignore it in my application because I have many of them.  I've tried using "wrapDateLine: true" in base layer and WFS layer with same results.  Not sure if this would be a GeoServer problem or an OpenLayers problem.  Does anyone know a solution to my international date line problem?
61738
I just started to play with leflet/geojson a little. But my coordinates are not rendered properly and I have no clue what is going on.  My coordinates are: 52.23943, 4.97599. They work correct with the setView function.  var map = L.map('leaflet_map').setView([52.23943, 4.97599], 15);   But using a geojasonFeature they are, hmmm, 'projected', somewhere east of Somalia.  var geojsonFeature = {             "type": "Feature",             "properties": {             "name": "Coors Field",             "amenity": "Baseball Stadium",             "popupContent": "This is where the Rockies play!"             },             "geometry": {                 "type": "Point",                 "coordinates": [52.23943, 4.97599]             }         };         var myLayer = L.geoJson().addTo(map);         myLayer.addData(geojsonFeature).bindPopup("I am a gjson point.");   Anyone who knows what is happening here?  EDIT  Out of pure curiosity I changed the coordinates around [4.976143930893815,52.23925499011473] and the point appears at its correct location. A known bug!?