OpenStreeMap: export a place's boundaries - openstreetmap

I'd like to export the boundaries (perimeter) of a place. For instance, consider the boundaries of the University of Illinois at Chicago at this link.
I see it's pretty easy to export an OSM file. But how can I export only that red line (perimeter)?
I don't need a script to do that, even a manual solution would be fine. I tried to navigate the UI for quite a time, but I couldn't find a way.
My ultimate goal is to convert the boundaries to a GeoJson.

You can use the Overpass API for this.
Go to https://overpass-turbo.eu and enter the following script:
[out:json][timeout:25];
way(210649421);
out geom;
The way-Id was taken from your link.
Then click on Run.
Afterwards, you can switch to the Data tab in the top right and copy the JSON for this area.
Alternatively, you can also use Export -> "raw data directly from Overpass API" to directly download a JSON payload, bypassing the browser output. For GeoJSON output, use Export -> "download/copy as GeoJSON" instead.

Related

Extrapolate Coordinates form Leaflet map

I'm planning a climbing trip and I wanted to retrieve the climbing locations from a leaflet map.
I thought I could use chromedriver and selenium to get the information I wanted but I'm having difficulty scanning through all markers since I can't understand where all the informations are stored.
Could someone guide me through how I could get the information? (also without using selenium)
The map in question is: https://www.climbingsardinia.com/topos/maps/
Thank you in advance.
in that page you will see a global variable called cttm_markers, it contains all markers informations and relative coordinates.
For example, cttm_markers[0][[0].additionalData.title evaluates "M.te Arci – Trebina Longa".Further, cttm_markers[0][[0]._latlng is an object {lat,lng} that contains coordinates.
Try to open console and paste this: JSON.stringify(cttm_markers[0].map(c=>({title:c.additionalData.title,latlng:c._latlng}))), it will print a json.
One way to do it is to get some information on one of the markers and use this to search the request reponses made by the page (you can do this in the debug tools, usually opened with F12). One of the markers for example reveals the location "Grighini". The base request redirects to (in my case) https://www.climbingsardinia.com/topos/maps/?doing_wp_cron=1651158093.0027918815612792968750
Searching the response, reveals that in line 1908 there's the string "Grighini". This line contains a serialized JSON array, containing the markers.

How can I create in Gehpi directed tree graph instead of sphererical

I want to make a network graph which shows the distribution of our documents in our folder structure.
I have the nodefile, edgefile and gephi graph file in this location:
https://1drv.ms/f/s!AuVfRBdVHkO7hgs5K9r9f7jBBAUH
What I do is:
Run the algorithm ForceAtlas2 with scaling 10-20, dissuade hub marked and prevent overlap marked, all other standard setting.
What I get is a graph with groups radial/spherical distributed. However, what I want is a tree directed network graph.
Anyone know how I can adjust Gephi to make this?
Thanks!
I just found a solution.
I tested the file format as shown on the Yed site "import excel file" page
http://yed.yworks.com/support/manual/import_excel.html
This gave me the Yed import dialog (took a life time to figure out that it's a pop up menu and not selectable through the standard menu)
Anyway, it worked and I've adjusted the test files with the data prepared for the Gehpi. This was pretty easy, I could used the source target ID's etc. Just copy paste.
I load it into Yed and used some directed and radial clustering algorithms on it. Works fine!
Below you can find the excel node/edge file used to import in Yed and the graph file you can open with Yed to see the final radial result.
https://1drv.ms/f/s!AuVfRBdVHkO7hg6DExK_eVkm5_mR
Only thing to figure out is how to combine the weight (which represents the number of documents) with the node size.
Unfortunately, as of version 0.9.0, Gephi no longer supports hierarchical graphs. Maybe try using a previous version?
Other alternatives involve more complex software, such as Graphviz, but you need a .dot file instead of your .csv. I looked all over, but could not find an easy-to-use csv to dot converter.
You could try looking at d3-hierarchy, a node.js program, but then again you need to use the not-so-user-friendly npm. If you look at the link, it looks like it can produce the kind of diagram you're looking for.

Show orion context broker poi in map viewer

For learning porpoises I am trying to run the default map viewer set up and show the POIs stored in the orion public instance (orion.lab.fi-ware.org:1026).. but it does not work at all.
Following screenshots with the default provided configurations. It should show a bunch of Santander POIs if I understood well.
1.-Wired mashups schema:
2.- NGSI Source default settings:
3.- NGSI entity to POI default settings:
4.- Map viewer default settings:
5.- Map viewer result (No results at all :(( ):
Everything looks pretty straight forward but nothing is shown. Without understanding why it is not working I can not moving forward and work in my own implementation.
thanks in advance.
It looks to me like you have not obtained an authorization token (or you are not showing it in your question?). Without one you are not able to retrieve information from orion.lab.fi-ware.org.
One way to get a token is running this python script:
https://github.com/telefonicaid/fiware-figway/blob/master/python/get_token.py
Of course, you do need a FIWARE Lab account to get it.
The problem seems to be in the configuration of the "NGSI entity to POI". The Node, AMMS and Regulators entities provide their coordinates using the Latitud (latitude) and Longitud (longitude) attributes.
The final value for the "Coordinate attribute" setting should be: Latitud, Longitud

Custom Search Results in REST MarkLogic

So new to MarkLogic am stuck and not finding the documentation of use. I know what i need to do, just do not know how to do it.
I have a keyvalue? search on my REST server which returns ML's standard search results and XML snippet. I want to create my own custom search result which will output a title element for my XML files.
I am aware that i need to create an XSLT transformation document and upload that to the server but do not know how to target ML's search function or how to write this out.
I have basic knowledge of XSLT, if i just created something that targets each files title using xPath will this work, or does ML require use of their custom functions?
I know its a bit broad, but hopefully someone can point steer me.
Sounds like you are talking about the GET /v1/keyvalue endpoint of MarkLogic REST API. Unfortunately that does not allow you to choose a transform. You can probably use GET /v1/search with a transform param instead though, using a structured query for an element value query. The docs contain a good syntax reference on that.
Docs on creating and managing transforms can be found here:
http://docs.marklogic.com/guide/rest-dev/transforms#chapter
HTH!
You can use extract-metadata in your search options with search:search or the /v1/search/ REST API endpoint to include the title element in a metadata element or JSON property in your results:
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:search(
"my query string",
<options xmlns="http://marklogic.com/appservices/search">
<extract-metadata>
<qname elem-ns="" elem-name="title"/>
</extract-metadata>
</options>)
If you need more flexibility, you specify a custom snippet implementation or a results decorator function in your search options.
Is this key-value or full text? For key-value you could use XPath. Any XPath that starts with / or // or fn:collection() or fn:doc() will search the entire database. You can search specific document(s) or collection(s) too.
For full text you'd probably want to use https://docs.marklogic.com/search:search - or possibly https://docs.marklogic.com/cts:search for really low-level control.
There's some example code using search:search from XSL at https://github.com/marklogic/RunDMC which might help. It doesn't use the REST API: it's a traditional form-submit web page. But the view/search.xsl code might give you some idea how to call the search API from XSLT.
That RunDMC code might also help you if you need to call XSL from XQuery: take a look at controller/transform.xqy.

Use OSM Map in SUMO

I want to export a Munich map from OSM for SUMO Simulator. I've managed to download such a map from bbbike.de(472MB), but when I'm converting it to .net.xml with netconvert I'm getting a lot of warnnings and the simulator cannot import the map ("Loading error"). Do you have any idea how can I convert correctly the map (or do you think it is because the big volume of the file?), or where could I get such a map(in a properly sumo format = xml, I acctualy need just the highways, I've tried to select just highways with osmosis but I have the same problem in the end)?
Ok to summarize our experience and to close this question :)
SUMO has problems with parsing big full OSM files. So you need to cut the area and filter for highways with osmosis:
Get the state of bavaria or of the surrounding http://download.geofabrik.de/europe/germany/bayern/oberbayern.html
osmosis --read-pbf ./oberbayern-latest.osm.pbf --bounding-box top=48.3298 left=11.2699 bottom=48.0460 right=11.8948 --write-xml ./munich.xml
osmosis --read-xml ./munich.xml --tf accept-ways highway=* --used-node --write-xml ./munich_streets.xml
This can be loaded to SUMO, esp. with the eWorld GUI.