I'm looking to plot all the subway stations in a city, with many stations in foreign countries that don't readily provide geocoordinates or addresses for their stations. How would I use the Google Places API, OpenStreetMap, or any other service to return the geocoordinates of all subway stations in a city?
AFAIK you can't use Google to get the data, as it's closed source.
For OSM you can query for railway=station tagged nodes (e.g. using OverpassAPI), but this includes also usual stations and not only subway. A better approach is to query for OSM 'route' relations that are tagged as route=subway and get all contained elements in a second step.
ÖPNVkarte and OpenPTmap use this technique to create a map styling focused on public transport.
The simplest way is using Overpass Turbo: I've prepared a query for you, just pan to your city and press "Run". To export found data, use "Export" tab. For example, you can download stations in GeoJSON.
You can probably get all subway stations for a country or two this way, but it could take some minutes.
Related
I am taking a database design class and for a project want to make a database of my mom's digital photos for her. I haven't dealt in application up to this point, only theory, but I have Access. Therefore, ideal answers don't suggest non-database solutions and don't assume I know much about actual database implementation. Solutions specific to Access could also be a plus. I hope that precursor saves some time and effort.
Theoretically, my mom wants to see all photos of pets from '05-'07 in raw format, and she enters an appropriate query. I suspect I can handle it up to there. However, at the moment, the best I can figure out to do is to return a column of either attachments or OLE objects. 5 clicks per photo is not ideal. I need a faster way to present the images. Opening them all in a grid of thumbnails or as a one-click-slide-show would seem the natural fit, but whatever works. How can I accomplish this?
Less important but worth consideration is the fact that, at some point, it would be great if this same type of system could be implemented on the internet for all of the family reunion photos she has taken, but I will take what I can get.
Use one form to get parameters for the query. then use another form(more processing) or report(if printing) to show the selected pictures. I will not cover passing parameters but here are some links.
https://www.fmsinc.com/microsoftaccess/forms/openargs/index.htm
https://learn.microsoft.com/en-us/office/vba/access/concepts/forms-design/apply-a-filter-when-opening-a-form-or-report
There is a complication, in Access pictures are usually stored in the attachment type. the attachment column can hold many pictures in each record. So if we have a table called Pictures with an attachment type column also called Pictures, then each individual picture is actually stored under Pictures.Pictures.FileData.
So to display the picture query we use a form/report with default view set to Continuous Forms (displays many records or in this case pictures on the same page) then in the details section of our Display form we place an attachment control and bind that control to our filtered Pictures.FileData.
Format and add functionality to taste.
Is ability to exclude a specific countries or regions from route present? For example, I plan to go from Ukraine to France, but I don't want to go thru Poland. How can I set this in GetRouteDirections API?
I'm not of a way to specify a specific country code to avoid all together. It is possible to specify which countries to avoid tolls, and to specify custom areas to avoid using GeoJSON using the POST Route Directions API: https://learn.microsoft.com/en-us/rest/api/maps/route/postroutedirections#request-body
Another approach is to add another waypoint in-between Ukraine and France to force the route to go around Poland. The coordinate (49.001636, 22.890648), goes through a point just below the Polish border and would put the user on a road where they would cross into Slovakia instead.
im trying to obtain some demographic data from the google analytics api, my intention is to integrate this on a cms to generate reports, etc... is this possible?
if it is, is there someone who knows a tutorial or something? i have used the examples provided and i get some sessions that have been in the last 7 day period. But nothing besides that. If that is not possible, what kind of things i can obtain with this api?
here is what i have tried:
function getResults(&$analytics, $profileId) {
return $analytics->data_ga->get(
'ga:' . $profileId,
'7daysAgo',
'today',
'ga:sessions');
}
thanks in advance.
You can obtain everything that's listed in the Dimensions and Metrics Reference. This includes ga:userAgeBracket and ga:userGender for demographic information.
To include additional metrics (numerical data) you put it as a parameter where you now have ga:sessions (separate multiple metrics with a comma). You need at least one metric for a query to work.
To add dimensions (i.e. categorical data) you need to pass an options array to your query that has a key/value pair for dimensions. This may also include additional options like filters or sort options, see the example here..
$optParams = array(
'dimensions' => 'ga:userAgeBracket,ga:userGender'
);
return $analytics->data_ga->get(
'ga:' . $profileId,
'7daysAgo',
'today',
'ga:sessions',
$optParams
);
This for version 3 of the API. If you are just getting started an have no legacy code to maintain you might as well start with there current version (v4).
To be able to get age and gender informations from analytics, you should Enable Demographics and Interests reports on your GA account.
doc : https://support.google.com/analytics/answer/2819948
I am writing a Chrome extension using AngularJS to add functionality to the Soundcloud stream page. I want to allow the user to create groups of artists so that they may only see a stream with tracks/shares/playlists from that group of artists.
For example, I follow 500 artists, but I want to quickly see a stream from my favorite 10 artists or from the artists I follow that are on the same label.
I am looking for advice on how I could go about making this as seamless as possible. As of right now, my approach involves getting the tracks with the Soundcloud API and using angular's ng-repeat to display the tracks in a view injected into where the stream normally goes. I realized using the Soundcloud widget was too slow and can't be customized to resemble the native stream items, so I copy/pasted the HTML that an actual stream item uses, but obviously the waveform/comment canvas and button functionality don't work.
What are my options as far as how I can approach this? Am I going to need to write my own players that look like the native Soundcloud ones? Any suggestions would be greatly appreciated.
You should use the SoundCloud API which is very well documented.
If you have already the id's of the tracks / artist, you just have to request the url
GET
http://api.soundcloud.com/tracks/ID_OF_TRACK.json?client_id=YOUR_CLIENT_ID
to get all the informations you need about this track, like the waveform_url, and for the comments you was talking about :
GET
http://api.soundcloud.com/tracks/ID_OF_TRACK/comments.json?client_id=YOUR_CLIENT_ID
To reproduce the behaviour of the comments :
POST http://api.soundcloud.com/tracks/ID_OF_TRACK/comments.json?client_id=YOUR_CLIENT_ID
(with a body param which represents the text and a timestamp in ms since the beginnin of the song, note that you must be connected)
If you don't have the id of the track, you could also use the resolve which give you all the info about a ressource if you have only the URL :
GET
http://api.soundcloud.com/resolve.json?url=https://soundcloud.com/poldoore/pete-rock-c-l-smooth-they&client_id=YOUR_CLIENT_ID
Can I get a location of mobile devices from j2me programming having no GPS unit installed?
Can I obtain the location using cell tower info? I heard about triangulation method.
And gone through http://developers.sun.com/mobility/apis/articles/location/ doc
In this doc they have given code only for mobile phones having GPS application installed.
But what about the others which does not have GPS in them? How can they get the location?
update I got a link which answers my question: http://mobiforge.com/developing/story/adding-location-a-non-gps-phone-introducing-cellid
You can get the ID of the nearest cell tower to you. The way this is fetched however differs from manufacturers. On Nokia phones, you can get it through something like these:
cellID = System.getProperty("Cell-ID");
if (cellID == null)
cellID = System.getProperty("com.nokia.mid.cellid");
while on Sony Ericsson, you have this:
System.getProperty("com.sonyericsson.net.cellid");
Once you get the cell id, you can easily use the OpencellID API to retrieve more information (coordinates, and all that) about the id. The two challenge with this though is that
Cell ids may not be accurate to a distance of up to a km
The information may not be available on opencellid.org