What happened to the POIs-module in OSMnx - and what to use now? - openstreetmap

I want to extract data from OSM, similar to this blogpost:
https://blogs.sap.com/2020/01/20/where-to-not-charge-my-car-openstreetmap-pois-in-sap-hana/
One of the first examples is:
gdf_poi = ox.pois_from_place('Germany', amenities=['charging_station'])
But this leads to: AttributeError: module 'osmnx' has no attribute 'pois_from_place'
Searching in the code I find this line in the changelog from version 0.16.2 to 1.0.0: - remove deprecated pois module
So - does anyone has an example on how to e.g. get a list of all nodes with amenity "charging_station" in Germany?

Yes this was deprecated a while back and eventually removed. The geometries module replaced it and offers this functionality. See the documentation https://osmnx.readthedocs.io/en/stable/osmnx.html#module-osmnx.geometries

Related

Difference Between Local Nominatim and OpenStreetMap Website results

I have installed nominatim 4.1.0 (tokenizer= ICU) via following instructions on nominatim documentation, added wikipedia data during the installation, and imported an updated pbf file from geofabrik.de.
All works but when I sent some kind of request (e.g. Cagliari via Roma) the answer I get from Nominatim Website (https://nominatim.openstreetmap.org/) and my local installation are very different. The right results are on nominatim website of course.
The problems seems to be with the search candidate algorithm or the attribuition/calc of AdressImportance parameter.
The very strange thing is that I get these wrong results only for some requests.
There is any particular parameter to set or anything else to verify?
I hope it is clear for you and even small advice or comment would be very helpful for me
Thanks
Michele
After a discussion with the maintainers (https://github.com/osm-search/Nominatim/discussions/2839), I found an acceptable solution by editing the Geocode.php file line as follows:
$this->iLimit = $iLimit + max($iLimit, 150)
the result is not exactly the same as that of the online version but it works fine for me

SerialSearch with Cursors

I am trying to use SerialSearch to identify about 800 titles with a single keyword. When I run:
serialSearch = SerialSearch(query={"title": "myKeyword"})
it gives me the first 200. I would like to get the remaining 600. I saw there is a start parameter that appears to be deprecated in favor of a cursor but I can't find any details on how to implement it. Is there a reference example for this?
With the current development version you can pass start=200 to the class, to get entries ranging from 200 to 399.
Install via
pip install git+https://github.com/pybliometrics-dev/pybliometrics
Then use
serialSearch = SerialSearch(query={"subject": "ECON"}, start=200, refresh=True)
The refresh=True bit is important, otherwise pybliometrics will use the old information.
Eventually Scopus implements pagination with cursors akin to the Scopus Search API, which would solve this problem.

How to filter results in Flutter package flappy_search_bar?

From what I read in the package documentation ,
the "searchBarController" parameter should allow to filter the results, but I can't find any documentation. I also read through the package content but can't find how to use it.
I found the answer to my question in the example file, which shows how to us the SearchBarController : https://github.com/smartnsoft/flappy_search_bar/blob/master/example/lib/main.dart

Make tile-ID request URL work with mapbox-style "satellite-streets" using folium

I use Python for plotting geospatial data on maps.
For certain map-styles, such as ["basic", "streets", "outdoors", "light", "dark", "satellite", "satellite-streets"], I need a mapbox-access token and for some geospatial plotting packages like folium I even need to create my own link for retrieving the map-tiles.
So far, it worked great with the style "satellite":
mapbox_style = "satellite"
mapbox_access_token = "....blabla"
request_link = f"https://api.mapbox.com/v4/mapbox.{mapbox_style}/{{z}}/{{x}}/{{y}}#2x.jpg90?access_token={mapbox_access_token}"
However, when choosing "satellite-streets" as mapbox-tile-ID, the output doesn't show a background map anymore. It fails with inserting "satellite-streets", "satellitestreets" and "satellite_streets" into the aforementioned link-string.
Why is that and how can I come to know what's the correct tile-ID-name for "satellite-streets"?
I found an answer when reaching out to the customer support.
Apparently, one has to access the static APIs which have specific names listed on their website:
"In general, the styles that you mentioned including
"satellite_streets" that you are referencing are our classic styles
that are going to be deprecated starting June 1st. I would recommend
using our modern static API the equivalent modern styles. This
will allow you to see the most updated street data as well.
Like the example request below:
https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/1/1/0?access_token={your_token}
Here is more info on the deprecation of the classic styles and
the migration guide for them."
My personal adaptation after having tried everything out myself, is:
Via combining the above-mentioned with the details on how to construct a Mapbox-request link on this documention from mapbox' website,
I finally managed to make it work.
An example request looks like so (in python using f-strings):
mapbox_tile_URL = f"https://api.mapbox.com/styles/v1/mapbox/{tileset_ID_str}/tiles/{tilesize_pixels}/{{z}}/{{x}}/{{y}}#2x?access_token={mapbox_access_token}"
The tileset_ID_str could be e.g. "satellite-streets-v11" which can be seen at the following link containing valid static maps.

How to make a Pod link from a module to a script within the same distribution?

Consider this module App::TimeTracker. If you click on the tracker link in the SYNOPSIS section you end up here whereas you should have ended up here. The Pod source code responsible for the behavior is given here, which shows that the following Pod formatting code was used:
L<tracker>
I can fix the problem by providing an absolute link instead:
L<tracker|https://metacpan.org/pod/release/DOMM/App-TimeTracker-3.000/bin/tracker>
but this fixes the link to version 3.000 which may change in the future.
So how should this be done in general?
Use the full path without the version number: https://metacpan.org/pod/distribution/App-TimeTracker/bin/tracker.
The problem is that tracker_bash_autocomplete is not being indexed correctly as documentation by MetaCPAN. The NAME section has a very specific format based on manpages which must be adhered to for MetaCPAN to know how to link to your documentation. Putting tracker bash autocomplete before the hyphen makes MetaCPAN index it as tracker.
=head1 NAME
tracker_bash_autocomplete - whatever