Hot answers tagged

25

I did a simple comparison a year ago showing eleven different geocoding services, free ones as well as pay services, and the results are in a google spreadsheet. I work at SmartyStreets, so you'll see that listed in the first column but not in first place. I tried to make the comparison unbiased so the results are actually useful. I have now opened the ...


23

Though I used Leaflet in my webGIS application, OpenLayers has much more advantages over Leaflet. For example if you want to use your application in mobile devices, OpenLayers is a must for the time being. There are lots of resources related with OpenLayers, however I think developing application with Leaflet is easier than OpenLayers (it is easier to read ...


14

The ArcSDE APIs date from the earliest days of ArcSDE. It was how you interacted with the data stored in a RDBMS. This was before there were ArcToolbox tools or many ArcObjects classes and methods. Because of this, the ArcSDE APIs have almost no support for geodatabase objects beyond points,lines,polygons--no feature datasets, network datasets, etc. The ...


13

There is a great comparison on the two frameworks in this presentation: And another article also has a great summary: Customers often ask us, “Which is the best client-side JavaScript mapping library to use when building a modern web app with the Map Suite WebAPI Edition?” Like a lot of things in Software Development, the answer isn’t always clear. The ...


10

Google Maps works so well because some clever people spent time making something incredibly complex appear to be simple. Switching to a new mapping API isn't going to automatically make your web map nicer to use - some alternative suggestions: Rather than making a mega-application with every possible layer, make a series of smaller, focussed apps Find some ...


10

I received help from an application developer at JNCC. I will post their answer here to help others. My problem was that I needed to escape the $ character before value. so the wget command should read (using the apihub, which you could replace with dhus): wget --no-check-certificate --user=username --password=usrpass "https://scihub.copernicus.eu/apihub/...


10

Overpass API doesn't support GeoJSON. You have to perform the conversion from JSON to GeoJSON yourself. For converting JSON into GeoJSON see this answer. It even contains a solution in Python. Another Python solution is contained in this answer.


9

Speaking purely from a data storage and analysis perspective, the geography type for PostGIS was designed with the antimeridian in mind (among several design goals). There are several functions specifically designed for the geography type. For instance, consider a LineString across Taveuni, Fiji (mapped with Great Circle Mapper), which straddles the ...


9

See the Overpass API Language Guide. Basically you seem to want all data in a bounding box. Depending on your use-case you might want to download nodes, ways and relations. overpass turbo already has a preset for this. Just go to Load and select Map Call. The resulting query is: [out:xml]; ( node({{bbox}}); <; ); out meta; Change xml to json to ...


9

Check the 'Provider Settings' where an API Key can be given Environment: QGIS 3.18 on Windows 10


9

Open ORS Tool window. Click Settings button.


8

As user30184 said, in Python, the process would be creating a memory raster of the same dimensions (layers and layer extension), and executing the CreateCopy after that: driver = gdal.GetDriverByName( 'MEM' ) driver2 = gdal.GetDriverByName( 'PNG' ) ds = driver.Create( '', 255, 255, 1, gdal.GDT_Int32) ds2 = driver.CreateCopy('/tmp/out.png', ds, 0) Then, ...


8

In the comments of the source code you linked there is an explanation: @param key To access the openstreetmap API you need a valid API key. You can get it for free at https://developer.mapquest.com For more info also see https://github.com/hrbrmstr/nominatim/issues/5


7

I spent a while trying to figure this out too. The button is found in the QgisInterface class. # Find the layer to edit layer = qgis.utils.iface.activeLayer() layer.startEditing() # Implement the Add Feature button qgis.utils.iface.actionAddFeature().trigger() Then add the features you wish to add to the layer.


7

The current GeoJSON specification is geojson.org/geojson-spec.html and it defines "positions" as A position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, ...


7

A good alternative to the official Scihub is the mirrored Sentinel-2 data on Amazon Web Services. Sentinel-2 on AWS This has the advantage of better uptime and the products are already saved in their MGRS tiles, which makes downloading a lot faster. The data is stored in a public bucket with the scheme tiles/[UTM code]/latitude band/square/[year]/[month]/[...


7

I guess you are using the QOSM plugin to display the OpenCycleMap, since the standard OSM map does not have API keys. You can obtain an API key from the map producer Thunderforest. They provide details here, including a sample tile request URL. You can add that to the properties of the QOSM layer, inserting the line http://a.tile.thunderforest.com/cycle/${...


6

Shapely is one of the Geos Python bindings and has cascaded_union and unary_union implemented since versions 2.16 (GEOSCascadedUnion is deprecated since GEOS version 3.2.+ and GEOSUnaryUnion must be used instead: it can operate on different geometry types, not only polygons as is the case for the older cascaded unions). Convert QGIS geometries to Shapely ...


6

You can use the rasterio library: import rasterio coords = ((147.363,-36.419), (147.361,-36.430)) elevation = 'srtm_66_20.tif' with rasterio.open(elevation) as src: vals = src.sample(coords) for val in vals: print(val[0]) #val is an array of values, 1 element #per band. src is a single band raster ...


6

A WFS is just an API but conveniently one where everyone has agreed a standard way of talking to it beforehand. So rather than having to read a new bunch of documentation and write some new code for every new dataset you would like to add to your client you can pull in a library that has implemented the standard and use that. As to why you might offer ...


5

I've just gone through this decision for my new mobile project and the clear winner is OpenLayers. Leaflet, as of this writing, was rather sluggish on mobile. The transitions for pan/zoom did not feel smooth and it was disorienting at times. Short of going native, I tried OpenLayers and the experience is much better. Still not as good as native, but ...


5

There is no way to do it "directly"... One way is to design a REST web service which would return GeoJSON data. A typical example is your client (OpenLayers map) sending a request to your server with the bounding box of your map viewport as parameter. All the mapping javascript libraries allow you to get the extent of the viewport. It's pretty easy then to ...


5

Using leaflet on the clientside could be a good idea: http://esri.github.io/esri-leaflet/ Apart from that, it generally takes hard work to make the UI simple.


5

You'll need to tap into the api's for twitter, flickr and youtube. twitter api: https://dev.twitter.com/docs/api/1.1 Discussion specific to twitter here (from 2010): https://stackoverflow.com/questions/4337319/how-to-search-only-for-geotagged-tweets Looking at the docs for twitter, you have to issue a get request to the api that includes a search location ...


5

Using QgsMapCanvasItem is the way to go here as you will not have to refresh the canvas. You just have to make sure your implementation is correct. Here is a basic example (taken from https://github.com/DMS-Aus/Roam/blob/master/src/roam/gps_action.py) class GPSMarker(QgsMapCanvasItem): def __init__(self, canvas): QgsMapCanvasItem....


5

If you do not find any it is not difficult to set up your own. Install Geoserver and you can get geojson out from WFS with requests like http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=topp:states&outputformat=application/json&propertyname=STATE_NAME,the_geom&CQL_FILTER=STATE_NAME=%...


5

A complete solution with also saving the layer, as requested in a comment: # Get the active layer layer = iface.activeLayer() # Define a function called when a feature is added to the layer def feature_added(): # Disconnect from the signal layer.featureAdded.disconnect() # Save changes and end edit mode layer.commitChanges() # Connect ...


5

Alternatively, a DEM with global coverage that might suit you is the SRTM 1 second DEM. This was recently released and has a resolution of about 30 metres. Read about it at http://www2.jpl.nasa.gov/srtm/ and download load it (free) at http://earthexplorer.usgs.gov/.


5

The Google Elevation API is not accurate enough at a Building level. You can test it out by using going to http://www.daftlogic.com/sandbox-google-maps-find-altitude.htm Just search for 1 World Trade Center, New York, NY 10007 and then click around, and you'll see that the heights that you get aren't really for the top of a building


5

You may use the QgsExpressionContextUtils() class. More in detail, you may set a new layer variable in this way: layer = iface.activeLayer() # or similar way for loading a layer QgsExpressionContextUtils.setLayerVariable(layer,'your_variable', 'John') where layer is the layer object, your_variable is the name of the variable and John is the value of the ...


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