I'm working with OpenLayers and loading a couple of GEOJson files which works perfectly. Now I want to be able to select individual components of the GEOJson file. As for example if I have more than one Feature (a couple of polygons) when I activate the hover selection, nothing happens.  I added the hover selector to this example    I can actually drag the elements independently but I can't select them. I assume it is because of the projection I'm using. Any Ideas how to fix it?   function init(){  var options = {     projection: new OpenLayers.Projection("EPSG:900913"),     displayProjection: new OpenLayers.Projection("EPSG:4326"),     units: "m",     numZoomLevels: 18, };  map = new OpenLayers.Map('map', options ); var mapnik = new OpenLayers.Layer.OSM({layers: 'basic'});            map.addLayer(mapnik);  map.addControl(new OpenLayers.Control.MousePosition());  var lon = 12.18; var lat = 53.81; var lonLat = new OpenLayers.LonLat(lon,lat).transform(map.displayProjection,  map.projection);  var mapcent = new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.projection); zoom = 5.5; map.setCenter(mapcent, zoom); document.getElementById('noneToggle').checked = true;  var proj = new OpenLayers.Projection("EPSG:4326");  var file = []; file[0] = "geojson/nuts3.geojson";  var style = [];  i=0; while(i&lt;file.length){     style[i] = new OpenLayers.StyleMap({         pointRadius: 2,         strokeColor: 'red',         strokeWidth: 1,         strokeOpacity: 1,         fillColor: 'red',         fillOpacity: 0.2     });      var layer_name = "layer_" + i;     vectorLayer[i] = new OpenLayers.Layer.Vector(layer_name,  {         styleMap: style[i],         projection: map.displayProjection,         preFeatureInsert: function(feature){         feature.geometry.transform(proj, map.getProjectionObject());         },     });     map.addLayer(vectorLayer[i]);         var gjson = new OpenLayers.Format.GeoJSON();     var featurecollection = ReadFile(file[i]);     //Readfile is just a normal Request.POST function        vectorLayer[i].addFeatures(gjson.read(featurecollection));       i=i+1; }  controls = {     selecthover: new OpenLayers.Control.SelectFeature(vectorLayer[0],{         hover: true,         highlightOnly: true     }) };  for(var key in controls) {     map.addControl(controls[key]);     controls[key].activate();  }              var report = function(e) {             OpenLayers.Console.log(e.type, e.feature.id);         };          var highlightCtrl = new OpenLayers.Control.SelectFeature(vectors, {             hover: true,             highlightOnly: true,             renderIntent: "temporary",             eventListeners: {                 beforefeaturehighlighted: report,                 featurehighlighted: report,                 featureunhighlighted: report             }         });           map.addControl(highlightCtrl);         map.addControl(selectCtrl);             }      The geojson file looks something like   { "type": "FeatureCollection", "features": [ { "type": "Feature", "id": 0, "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [ 9.244170, 48.847009 ], [ 9.246171, 48.822260 ], [ 9.248220, 48.796910 ], [ 9.248433, 48.794277 ], [ 9.290007, 48.791633 ], [ 9.298732, 48.785304 ],  [ 9.145165, 48.859655 ], [ 9.153553, 48.861241 ], [ 9.207493, 48.852769 ], [ 9.235667, 48.848344 ], [ 9.244170, 48.847009 ] ] ] } }   ,   { "type": "Feature", "id": 1, "properties": {}, "geometry": { "type": "Polygon",   "coordinates": [ [ [ 9.064848, 48.755577 ], [ 9.038994, 48.741317 ], [ 9.104720, 48.709080 ], [ 9.104721, 48.709079 ], [ 9.146561, 48.663574 ], [ 9.156822, 48.652414 ], [ 9.162166, 48.646602 ], [ 9.174173, 48.633544 ],  [ 9.064848, 48.755577 ] ] ] } } ,   ... etc
121131
I have added vector layer to map:      vactorTest = new OpenLayers.Layer.Vector("Editable Features", { strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy], projection: new OpenLayers.Projection("EPSG:900913"), protocol: new OpenLayers.Protocol.WFS({     srsName: "EPSG:900913", url: "http://localhost:8080/geoserver/wfs", featureType: "ROADS", featureNS: "http://localhost:8080/MIA", featurePrefix: "MIA", geometryName: "GEOM", version: "1.1.0" }) });  map.addLayer(vactorTest);   And then, added polygon draw control:  var drawPolygon = new OpenLayers.Control.DrawFeature( vactorTest, OpenLayers.Handler.Polygon, { title: "Draw Polygon", displayClass: "olControlDrawFeaturePolygon", multi: true } );   with drawn polygon I want to filter layer:  testLayer.mergeNewParams({     "CQL_FILTER": mergeFilter });   I use within filter:   WITHIN(GEOM, POLYGON((4693721.49445 672633.89194, 4560244.10812 322255.75282, 4703732.29843 422363.79257, 4693721.49445 672633.89194)))   target layer is in Georgia, and if I draw polygon near Italy then, filter works.  How can I change vector projection like my layer to get right result?
57274
I'm using leaflet to display a map.  I have a control section that I'd like to be open by default, but I can't find a way to do it through the . Is there a way to do this?
87909
I want OSM administrative boundaries from . I can get the geodata in different formats there, but the attribute data always is a separate JSON file. I want them both in just one file, or to be able to merge the information.   I haven't found a solution to merge the GeoJSON.   What's the workflow to get the two files joined and saved as a shapefile, for example?
96601
I have a points shapefile and a polygon shapefile. I work in ArcGIS Pro. I would like to select all the polygons which have one or more points in them, however, one condition should be considered, that if one point lies in two or more polygons which overlays, only one polygon is selected. Please see picture for example. There are 3 polygons highlighted with orange circle with only one point in them. As the polygons overlay, the result I obtained from ArcGIS Summarize Within tool showed that each of these polygons consist of one point, which is wrong, cause there are not 3 points, but 1. There should be only one polygon with one point, the other one stays empty.  The result should look something like this. Orange points are selected polygons with one or more points. And pay attention to black line - these are polygons which overlays and shares a point, but only one of them are selected. Of course this could be done manually, but it's too time consuming and it gets hard when there are to many overlaying polygons, so I try to find a fast way to do this.  Here is a very similar question  about at least one and more points in polygon, but the solution selects all polygons with intersection, even if they overlay and share a common point. I couldn't find the solution with &quot;Join attributes by location&quot; or &quot;Select attributes by location&quot;. I'm probably missing something and this should be done easily. Is there some fast and effective way to do this?
120003
I have a question about Openlayers3 , I have the below code that initializes my map on my small demo application:  var map = new ol.Map({     layers: [         new ol.layer.Tile({             source: new ol.source.OSM()         })     ],     target: 'map',     controls: ol.control.defaults({         attributionOptions: /** @type {olx.control.AttributionOptions} */ ({             collapsible: false         })     }),     view: view });    You can see a demo   Now my question is how do I get the Tile url , so that I can store it locally using localstorage ? how do I get the Tile url ?   I saw the  , but I am not sure how to use it ? can anybody help me understand how to get the tile url ? (can can play around in the Chrome Developer Tools for the demo that I have provided.)
112978
I have a WFS layer:  myVecLayer_disp= new OpenLayers.Layer.Vector("Редактируемый участок",{projection: new OpenLayers.Projection("EPSG:900913")});   And i have feature store:          var protocol=new OpenLayers.Protocol.HTTP({             url: url_servlet+"fullSearch.jsp",             format: new OpenLayers.Format.GeoJSON({internalProjection: new OpenLayers.Projection("EPSG:4326"),externalProjection:new OpenLayers.Projection("EPSG:900913")})     });     searchStore = new GeoExt.data.FeatureStore({         layer: myVecLayer_disp,         fields: [             {name: 'id', type: 'String'},             {name: 'name_dispatcher', type: 'String'},             {name: 'voltage', type: 'String'},         ],         proxy: new GeoExt.data.ProtocolProxy({             protocol: protocol,         }),         autoLoad: true,         layerOptions: function() {             return {                 strategies: [new OpenLayers.Strategy.BBOX()],                 //projection:"EPSG:4326"             };         }     });   As you see i use GeoJSON. In this geojson i have features in wgs84. And reproject it in mercator in protocol. Now i show this layer:      app.mapPanel.map.addLayers(myVecLayer_disp); myVecLayer_disp.visibility=true;   And see features near Africa but expect to see it within Russia. So Nothig reproject i think. But when i see layes's features:      LINESTRING(0.00055807640304122 0.00050642147755534,0.00055807616948463  0.00050641930362077,0.00055807588202664 0.00050641664462617,0.00055807423809849  0.00050641332981391,0.00055807306129967 0.00050640979946183,0.00055807191147579  0.00050640644872202,0.00055807052802261 0.00050640231648177,0.00055806910873212  0.00050639813934481,0.00055806841697321 0.00050639609116937,0.00055806763547558  0.00050639388128181)   Ant this is same feature in geojson:  {"type":"LineString","coordinates":[[62.124781001642077,56.374581001212391], [62.124755002241727,56.374338999945053],[62.124723002564679,56.374043002482722], [62.124540001320156,56.373673997157425],[62.12440900067503,56.373281000617851], [62.124281002866155,56.37290799870533],[62.124126997563053,56.372447999975407], [62.123969002867341,56.371983002813522],[62.123891996618511,56.371755002191776], [62.123805000700372,56.371508997142655]]}   What i doing wrong?
23197
I created a layer that contains points and I added it to a map as WMS layer in OpenLayers. I did a CQL filter and it works but I'd like to zoom to the selected point when I worked with getextent or getdataextent it doesn't zoom to the right place. It missed with a few Km. Here is my the code of filter:   function filterNom(){             var filterType ="cql";             var filter = document.getElementById('batima').value;             // by default, reset all filters             var filterParams = {cql_filter: null};             if (OpenLayers.String.trim(filter) != "") {                 if (filterType == "cql")                      filterParams["cql_filter"] = "batiment='"+filter+"'";              }             // merge the new filter definitions             wfs_layer.mergeNewParams(filterParams);             var bounds =  new OpenLayers.Bounds             bounds = wfs_layer.getExtent()             map.setCenter(wfs_layer.getExtent(),18);             var center = map.getCenter();             center.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));             alert(center.toString()); }   and here is the code to add the WMS layer:    wfs_layer = new OpenLayers.Layer.WMS("Patrimoines",         "http:// localhost/geoserver/cite/wms",          {layers: 'cite:patrimoine' , transparent: true },         {isBaseLayer: false, opacity: 1, singleTile: true, visibility: true,          projection: 'EPSG:900913'});
56840
I have a problem with GetFeatureInfo (I'm working with openlayers).  In my HTML file I have this:    &lt;div id="map" class="jumbotron"&gt;       &lt;h1&gt;Sieraków &lt;span class="badge badge-secondary"&gt;MAPA&lt;/span&gt;&lt;/h1&gt;   &lt;/div&gt;   &lt;div id="info"&gt;&lt;/div&gt;   And I want to show some info in div #info.  In javascript I have layer from geoserver:  var theurl = 'http://localhost:8080/geoserver/sierakow/wms';     var jeziora = new ol.layer.Image({           source: new ol.source.ImageWMS({             url: theurl,             params: {'LAYERS': 'sierakow:jeziora'},             serverType: 'geoserver'           })     });     map.addLayer(jeziora);      map.on('singleclick', function(evt) {             document.getElementById('info').innerHTML = '';             var viewResolution = view.getResolution();             var url = jeziora.getGetFeatureInfoUrl(               evt.coordinate, viewResolution, 'EPSG:4326',               {'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': 50});             if (url) {               document.getElementById('info').innerHTML =                   '&lt;iframe seamless src="' + url + '"&gt;&lt;/iframe&gt;';             }     });   To do this I followed this examples:  I also try  with parsing but result is the same, nothing happend. My div #info is still empty and I don't know why.   Console show me this errors:  Uncaught TypeError: jeziora.getGetFeatureInfoUrl is not a function  Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.   This is url:   http://localhost:8080/geoserver/sierakow/wms?SERVICE=WMS &amp;VERSION=1.3.0 &amp;REQUEST=GetFeatureInfo &amp;FORMAT=image%2Fpng &amp;TRANSPARENT=true &amp;QUERY_LAYERS=sierakow%3Ajeziora &amp;LAYERS=sierakow%3Ajeziora &amp;INFO_FORMAT=text%2Fhtml &amp;FEATURE_COUNT=50 &amp;I=50 &amp;J=50 &amp;CRS=EPSG%3A4326 &amp;STYLES &amp;WIDTH=101 &amp;HEIGHT=101 &amp;BBOX=6919511.668971639%2C1779979.5230483634%2C6921441.703935839%2C1781909.558012564   And this error shows:  Refused to display 'http://localhost:8080/geoserver/sierakow/wms?SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetFeatureInfo&amp;FORMAT=image%2Fpng&amp;TRANSPARENT=true&amp;QUERY_LAYERS=sierakow%3Ajeziora&amp;LAYERS=sierakow%3Ajeziora&amp;INFO_FORMAT=text%2Fplain&amp;FEATURE_COUNT=50&amp;I=50&amp;J=50&amp;CRS=EPSG%3A4326&amp;STYLES&amp;WIDTH=101&amp;HEIGHT=101&amp;BBOX=6918701.436880034%2C1786965.867550262%2C6920631.4718442345%2C1788895.9025144626' in a frame because it set 'X-Frame-Options' to 'sameorigin'.   I will be greatful for every tips how to do that :)
78868
In PostGIS 2.0, I am seeking an efficient way to create a spatially enabled view that is viewable in QGIS.    I followed the context of Part 2 of @Mike Toews answer to , and the view shows up as a point layer (in my case) in the "Add PostGIS Layers" dialog.  But after creating the view and spatially enabling it, I received the following error when trying to add the view to QGIS:     You must select a table in order to add a layer   Can someone explain why the spatial view will not load into QGIS, and what I need to do in order to make it loadable as a layer in QGIS?  I'm currently using QGIS v1.8 from the OSGEO installer  I view is built from the geonames database, loaded into PostGIS.  The geoname table/spatial data can be selected/viewed in QGIS just fine.  When I try to select the "mt_view", QGIS sees the view in the dialog, but won't let me select it.  It gives a dotted box around the area, but does not highlight and select the view.      I just noticed that when I run my first query:  CREATE OR REPLACE VIEW data.test AS SELECT * FROM data.geoname WHERE admin1='MT'   the view shows up in the QGIS Add Layer Dialog, but is unselectable.  Then when I run:  SELECT Populate_Geometry_Columns('data.test'::regclass);   I get the result of "0", where according to the , I think it should be returning "1".
6810
I'm using OpenLayers to show my map with some layers. I've a field where I can add some filters with CQL code. I can successfully add a new filter to my map, and only the right points appear in my map but when I try to remove the filters it's deleting my Layer instead of my previous CQL_Filter result, so is deleting ALL the points from the map.   //My var map is previously declared var layerFromMap = map.getLayersByName(input.name)[0]; //If my input is empty then I should delete the filters, like resetting the search if (input.value.length &gt; 0) {     layerFromMap.mergeNewParams({ 'CQL_FILTER': input.value });     layerFromMap.redraw(); } else {     delete layerFromMap.params.CQL_FILTER;     layerFromMap.redraw(); }   When input is empty layerFromMapparams.CQL_FILTER is deleting my layer from the map, so all the points are deleted. Why is this happening? How can I only remove the filter so all the points appear again?
77366
I've added a polygon layer and a point layer to my leaflet map.   I would like the points to appear after a certain zoom level or when a "click" event occurs e.g. (polygons.on("click", function....)  I have looked at different questions here and also this   But I am still unable to understand what to do in my code.   Here is my code:  &lt;script type="text/javascript"&gt;    var mapboxTiles = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {     attribution: '&lt;a href="http://www.mapbox.com/about/maps/" target="_blank"&gt;Terms &amp;amp; Feedback&lt;/a&gt;'   });   var map = L.map('map')     .addLayer(mapboxTiles)     .setView([42.444508, -76.499491], 4);    var polygons =  new L.geoJson(null, {       pointToLayer: function (feature, latlng) {           return L.marker(latlng, {});       }   });   var points =  new L.geoJson(null, {       pointToLayer: function (feature, latlng) {           return L.marker(latlng, {});       }   });    points.bindPopup("popup.").openPopup();   polygons.on("click", function (event) {       map.fitBounds(event.layer.getBounds());   });    polygons.addTo(map);   points.addTo(map);    $.getJSON('polygons.php', function (data) {       polygons.addData(data)   });   $.getJSON('points.php', function (data) {     points.addData(data)   });  &lt;/script&gt;
91898
in QGIS, how do I make the selection color transparent? I need to split a polygon and i want to see the layer underneath it. But I have to select the polygon in order to cut it, and when i do that it turns yellow!
64405
1 2 3 4 5 6 7 8 In most UIs, selecting item 2 and shift+clicking on item 6 would select the following: 1 2 3 4 5 6 7 8 but in Illustrator when you click on the target icon in the Layers panel to select a layer and shift+click another layer, it does not select any of the layers between them. How can this be accomplished?
101414
I'm using Leaflet and trying zooming on a LineString object from a geojson file. Here is an extract of my file (with a lot of LineString objects):  {   "type": "FeatureCollection",   "features": [     {       "type": "Feature",       "properties": {         "day": "Day 1",         "route": "A - B",         "id": "a-b",         "distance": "256 km",         "profile": "img/profiles/route1.png"       },       "geometry": {         "type": "LineString",         "coordinates": [           [             13.6184281,             45.919077,             0           ],           [             13.6184281,             45.919077,             0           ],           [             13.6186132,             45.9190975,             0           ],           [             13.6195585,             45.9191768,             0           ],           [             13.6198306,             45.9191968,             0           ],           [             13.6201896,             45.9192233,             0           ],           [             13.620569,             45.9192515,             0           ],           [             13.6207494,             45.91926939999999,             0           ],           [             13.6213905,             45.91933280000001,             0           ],           [             13.6216616,             45.9193558,             0           ],           [             13.6224639,             45.9194158,             0           ],           [             13.6235211,             45.9195027,             0           ],           [             13.6241017,             45.91955149999999,             0           ],           [             13.6251088,             45.9196336,             0           ],           [             13.6253359,             45.9196521,             0           ],           [             13.6261509,             45.9197173,             0           ],           [             13.6271895,             45.919803,             0           ],           [             13.6275854,             45.9198347,             0           ]         ]       }     }   ] }   When I click on a HTML element as follows,  &lt;h4&gt;&lt;a class="zoom-to-route" id="a-b"&gt;A - B&lt;/a&gt;&lt;/h4&gt; &lt;h4&gt;&lt;a class="zoom-to-route" id="b-c"&gt;B - B&lt;/a&gt;&lt;/h4&gt;   I'd like to zoom to the corresponding line extent of my geojson file. I can access the geojson file, but I can't retrieve the whole set of coordinates in order to zoom on them:  $(".zoom-to-route").on("click", function(){     var routeId = this.id;       console.log("searching routeId: " + routeId);     var i = 0;       $.getJSON("data/routeHoliday.geojson", function(data) {          $.each(data.features, function (key, val) {             $.each(val.properties, function(propertyKey, propertyVal) {                 console.log(propertyKey, propertyVal);                               if (routeId == propertyVal) {                     console.log("Found " + propertyVal);                     var zoom = data.features[i].geometry;                     console.log(zoom);                     map.fitBounds(zoom.getBounds());                                     }                            });             i++;         });     }); });   The console.log is as follows:  searching routeId: a-b id a-b Found a-b Object { type: "LineString", coordinates: Array[5602] }
15208
I tried to display data with popup from Geoserver or Postgres to my map, but it dosen't work at all. Can anyone please help me? I used this code:      function Info(e)          {                 if (e.features &amp;&amp; e.features.length)                  {                      //console.log(e.features[0].attributes);                     var popupId = e.xy.x + "," + e.xy.y;                     var popup = popups[popupId];                     if (!popup || !popup.map) {                     popup = new OpenLayers.Popup.FramedCloud(                     popupId,                      map.getLonLatFromPixel(e.xy),                     null,                     " ",                     null,                     true,                     function(e) {                         delete popups[this.id];                         this.hide();                         OpenLayers.Event.stop(e);                     }                 );                 popups[popupId] = popup;                 map.addPopup(popup, true);                 }                popup.setContentHTML(popup.contentHTML + "nom_user:" +e.features[0].attributes.nomservice +" region_user :"+ e.features[0].attributes.region);             popup.show();                                    }       selectcltr = {         click: new OpenLayers.Control.WMSGetFeatureInfo({             url: 'http://localhost/geoserver/wms',              title: 'Identify features by clicking',             layers: [ser],             queryVisible: true         }),         hover: new OpenLayers.Control.WMSGetFeatureInfo({             url: 'http://localhost/geoserver/wms',              title: 'Identify features by clicking',             layers: [ser],             hover: true,             // defining a custom format options here             formatOptions: {                 typeName: 'projet',                  featureNS: 'http://www.openplans.org/topp'             },             queryVisible: true         })     }
88252
I have a Leaflet WMS Layer  layer = new L.tileLayer.wms('https://{s}.url.com/wms?', {     layers: 'Workspace:Layer',     format: 'image/png',     version: '1.3.0',     transparent: true,     styles: 'style1', });   If I choose 'style2', it works as expected, but I want to change it dynamically with a select box. I tried the following but it does not work:  &lt;select id="styles"&gt;     &lt;option selected="selected" onselect="layer.styles='style1';"&gt;Style1&lt;/option&gt;     &lt;option onselect="layer.styles='style2';"&gt;Style2&lt;/option&gt; &lt;/select&gt;   I also tried with layer.options.styles=''
117743
I would like to convert a shapefile to geojson using python window in arcmap. I did not find any python code to do so. any idea?  I want to import my shape in a leaflet map but since there are too many shapefiles I want to automate the process.