Hot answers tagged

19

You could use the Leaflet search control. It allows you to insert a search widget on your map, search by place names around the world (see Nominatim example), and once a place is selected, zoom/center your map to that place location. In the Leaflet search's GitHub website you find examples on how to add the control to your leaflet map.


11

Using Overpass turbo, the syntax is: area["name"="Nordrhein-Westfalen"]->.boundaryarea; ( nwr(area.boundaryarea)[amenity=bank]; ); out meta; nwr is a short for node-way-relation


9

I am using Search Layers plugin for the searching all the features of all the layers of the of the project. It is working fine for me. Yes, when you select a search result, it zooms to that particular feature.


7

The Quick OSM plugin for QGIS generates the following working Overpass query: <osm-script output="xml" timeout="200"> <id-query {{nominatimArea:Austria}} into="area"/> <union> <query type="node"> <has-kv k="amenity" v="bank"/> <area-query from="area"/> </query> <query ...


7

I would use format instead, since % is probably your wildcard character. def searchHospitals(work,strZip): fc= "Hospital.shp" whereClause= '"ZIPCODE" LIKE'+"'{0}%'".format(strZip) But you can also use double percent signs (%%) in your method: def searchHospitals(work,strZip): fc= "Hospital.shp" whereClause= '"ZIPCODE" LIKE'+"'%s%%'"% ...


7

Have you tried to type af search_value in the locator bar (linked documentation) ? On the left side of the status bar, the locator bar, a quick search widget, helps you find and run any feature or options in QGIS. Simply type text associated with the item you are looking for (name, tag, keyword…) and you get a list that updates as you write. Beginning with ...


5

The two links ThomasG77 posted are great, especially Fusesearch, but I could not get it to work. I installed Fuse but still could not get it running. So I settled for Leaflet Search. The examples given is not that informative so here is a nice example that I found that works great. Hope this helps. In the example replace LayerNameJSON with your geojson ...


5

There are various solutions for this (if you don't want exact zoom but centering). You can use using the list from Leaflet plugins page: Leaflet search Fusesearch You can also take a look on the Bootleaf project, a Bootstrap based Leaflet template using typehead.js (an autocomplete search box). All the mentioned projects above have demos available so you ...


5

(For QGIS 3.x, Locator bar at the bottom of the window) As @fuzzysolutions mentioned, use f <search_term> to search for any attribute on the active layer. Use af <search_term> to across all layers by Display Name (configurable under Layer Properties -> Display) Search Layers plugin is still needed to search all layers by any attribute. ...


5

It sounds like you are after the GoTo XY tool which is on the Tools toolbar: You can use this tool to type in x,y coordinates and navigate to them. The coordinates you enter can be Longitude-Latitude ...


5

The token "SHAPE@XY" populates the geometries of the feature. You won't see the results in your output table. If you have fields for X and Y use their names instead of "SHAPE@XY". with arcpy.da.InsertCursor(fc,['Sp','X', 'Y']) as iCurs: with arcpy.da.SearchCursor(fc, [X, Y, ID]) as sCurs: for row in sCurs: row = (row[2],row[0],row[1])...


4

It sounds like you could do it with with Solr. However, I would use ElasticSearch its easier to get started with. Since you are working with points it seems like a good fit. You would use it standalone as a datasource to Openlayers, it doesn't act act as a "store" to geoserver.


4

MMQGIS has some nice searching tools: http://michaelminn.com/linux/mmqgis/ It's available as a plugin, and when installed, there's a white button available that does simple, fast searching on an attribute field. That works really well for searching for a value in a dataset you have. It can also search using the Google Places API or Open Street Map, so you ...


4

Figured it out. Boy that was easy! >>> import arcpy ... ... fc = "C:\Users\PythonTesting.gdb\My_File" ... f1, f2, f3 = "EDITOR", "COUNTY", "OBJECTID" ... clause = arcpy.AddFieldDelimiters(fc, f3) + "= 1" ... for row in sorted (arcpy.da.SearchCursor (fc, [f1, f2], clause)): ... print ("{0}_{1}".format(row[0], row[1])) ... name =("{0}_{1}"....


4

I'm assuming that you want to use the leaflet-search plugin, without using NPM. This is possible, using these steps: Go to https://github.com/stefanocudini/leaflet-search Click on the Clone or download button, and download as Zip Unzip the downloaded file. Copy the dist & the images folder to your application. In your Application's HTML file, add links ...


4

Searching is possible with WFS, with WMS is not possible as WMS only gives image. Since GeoServer is used WFS should be available. With WFS you can query features with certain property values like this http://example.com/geoserver/wfs? service=wfs& version=2.0.0& request=GetFeature& typeNames=namespace:featuretype& propertyName=...


3

You can send any of the options available for the ESRI's Geocoder dijit to the CMV geocoder widget since it is simply a wrapper around the ESRI dijit. For your example of adding your own geocoders, your widget options in config/viewer.js would look something like this: geocoder: { include: true, id: 'geocoder', type: 'domNode', path: 'gis/...


3

When there is a boundary relation for that city area (like political boundaries) you can use its name for a query via overpass-api or overpass-turbo. So first find out about any good boundary relation within the OSM data: go to http://nominatim.openstreetmap.org and try to find a boundary relation for your city ... for example type "Buxtehude" in its search ...


3

Group the layers within a layerGroup or a featureGroup as described in the docs layer: L.featureGroup([syriaLayer, countryBoundary]),


3

I have a function I call all the time for doing this, but first, you'll need a common field to join by. From the screenshot, looks like you have a one to many relationship between the fields with several road names ('{DEER HOLLOW WAY}{HUNTERS GLEN WAY}{HUNTERS GLEN WAY}') and those with single field names ('DEER HOLLOW WAY'). You'll want to make a field ...


3

Searching in GeoJSON features on a specific "attribute", especially through a search box, is not part of standard Leaflet API as far as I know. Do you mean you use a plugin that does not support polygons? If so, please can you kindly detail which plugin you are using? I know Leaflet Control Search plugin has no problem searching into GeoJSON markers and ...


3

Try this: import arcpy aWS = r"C:\Users\dav\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\Connection to OracleGDB.sde" arcpy.env.workspace = aWS arcpy.env.overwriteOutput = True luList = arcpy.ListTables("*LK") for lu in luList: print lu #Get the name of the second field in the current table fieldsInTable = arcpy.ListFields(lu) ...


3

You do not necessarily need to draw a map if you are working with an entered zip code. Turf.js which was made for working with JavaScript mapping however could be really useful. The aggregate function could be helpful you here if you can use the counterpoints of counties. You could also use polygons, but it will be more complicated. Simply using center ...


3

If I understand what your original code was doing, you are looking for duplicate ID values in your AssetID column. This modification of your Search Cursor will create a python Set to store all AssetID values, and before it stores each one it will check if the ID already exists in the set. If it does exist then it's a duplicate, and so is written to the ...


3

Create a Dictionary using da.SearchCursor, then update: import arcpy fc = r"path/dat_1" tbl = r"path/dat_2" common_id_field = "ogr_id" valuefield = "field_1" d = {ogrid:value for ogrid,value in arcpy.da.SearchCursor(tbl, [common_id_field, valuefield])} with arcpy.da.UpdateCursor(fc, [common_id_field, valuefield]) as cursor: for row in cursor: ...


2

You could also try the Full Text Search PostgreSQL capabilities and that would still match your architecture (OL, GeoServer and PostgreSQL). Here you have a very nice resource on PostgreSQL FTS: http://blog.lostpropertyhq.com/postgres-full-text-search-is-good-enough/ According to it, you should build a GiST (and not a GIN) index because it works better ...


2

You can't search a WMS for a textual string, it's not part of the WMS standard. You will need to search some other service, perhaps a gazetteer, perhaps a WFS, and use the results of that service to give you a bounding box which you can use to define your WMS request.


2

Try setting up your vector layer with a filter, strategy, and protocol. and event handler. I have not included any protocol code. The protocol will bind you wms layer to the vector layer, so to speak. Possibly; strategies: [new OpenLayers.Strategy.Fixed()], filter = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO, ...


2

Just to revive this old thread for others: Searching features (and many things more) has been greatly improved in QGIS 3.x by the QGIS locator bar. There is less need for additional plugins now. For features, type "f ATTRIBUTE" with any attribute - you get a list of suggestions with the field name and the respective attribute value. Select using the arrow ...


2

In VB.net: Dim pWSF As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory() Dim pWS As ESRI.ArcGIS.Geodatabase.IWorkspace = pWSF.OpenFromFile("C:/Users/lyao/Documents/ArcGIS/Default.gdb", 0) Dim pFws As ESRI.ArcGIS.Geodatabase.IFeatureWorkspace = CType(pWS, ESRI.ArcGIS.Geodatabase.IFeatureWorkspace) Dim pTable ...


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