OpenStreetMap Java load place on map - java

As a newbie I'm making a Java desktop application based on OpenStreetmap, jXMapKit library.
What I have actually done is displaying map and possibility to center possition by typing X and Y coordinates.
Moreover I would like to display/load on my map some places like: cinema, theater etc. but I don't have any idea how to do it.
Is there any chance to download some list of places from any website and display it on my app?
Regards

Take a look at Overpass API. For downloading specific POIs you need to know their key-value-pairs. For cinemas this is would be amenity=cinema. Also take a look at overpass-turbo. This is a webfrontend for Overpass API and allows you to play around with your queries and to visualize the results.

Related

static map line between points

I can't find a way to show on a static map the line between 2 points.
I can see that in javascript you use something like that.
I am trying something like:
https://dev.virtualearth.net/REST/V1/Imagery/Map/road/33,-79.1;34,-78/7?mapSize=600,300&color=red&format=png&key=thekey
but just shows the map without any points or lines.
I can't find where and how to put the 2 coordinate points.At what point exactly?
The Bing Maps REST services do not support line drawing other than a route path (which is calculated by Bing Maps). You can have the image display the points on the map as pushpins as documented here: https://msdn.microsoft.com/en-US/library/ff701724.aspx
If you want to draw a line on the image you will need to do this afterwards in your code. I have an old code sample that used the Bing Maps SOAP services (same idea as REST just a different way of requesting the image). Getting this to work with the REST services would be fairly easy. https://rbrundritt.wordpress.com/2008/11/03/ve-imagery-service-polygons-and-polylines/
That said, you likely will find using the JavaScript API much easier and would provide a lot more options. If you are building a desktop app, you can host the map inside of a web browser control easily.

Interactive Android Google Map that returns a single route

How can I implement an interactive map using Google Maps API that prompts a user to select a route? For example, the Place Picker (https://developers.google.com/places/android-api/placepicker) is an interactive map that allows the user to search and select a location and I can get that information using onActivityResult(). I am looking to do something similar, but for a specific route from point A to B.
The easiest way I can think of for getting this information currently is to use the PlacePicker to get the user to choose origin and destination. Then I would use the Directions API to get the available routes. Then plot the available routes on a map and prompt the user to choose one. But this way seems a bit messy and I would like it if the user could just do everything in 1 interactive map that returns a specific route to the app.
Any suggestions on implementing the cleaner solution? What combination of Google Maps APIs could I use to achieve it?
This javascript-related question acheives something similar to what you are asking, but not with the Android API. Two possible ways forward would be:
Use the API in a similar way to them, with waypoints and directional
arrows.
Do what they did in a browser (for example in HTMLView) and put an
invisible View on top to get the clicks and select the route that way
(change the color of the selected route after getting the click).
The key information from the answer linked and others around the web seems to be to use Multiple DirectionsRenderer objects, possibly stacked in an Array.

How to define custom area using Google Maps API and Java

I'm trying to build an application with Java where I need to define some custom areas which are not readily available (e.g. jurisdictions for different police stations or fire stations in a city). My goal is to find out that, given an user's location, which jurisdiction that is a part of. I tried the Google Maps API, but couldn't find a solution.
Can anyone please help me find the solution using Google Maps API or any other API.
You can try using PolyUtil.containsLocation(LatLng point, List polygon, boolean geodesic) from Android-map-utils
That given the list of latitude and longitude that defines your custom areas you can check if current location is inside or not.

Java - Convert touch input to text character

I'm attempting to make an app for Android and part of it includes the ability for me to convert an array of entries of x,y coordinates in to a character. e.g. if the coordinates form an L shape, it should return the character L.
I would assume that something like this exists already as I have seen similar things in other apps, although during my searching I wasn't able to find anything that did what I wanted (or I used the wrong search terms).
Does anyone know of any open-source systems that do this, or know of a good method for this?
Thanks for any help :)
For anyone who may want to do this in the future, I ended up using Gestures by Android - http://developer.android.com/reference/android/gesture/Gesture.html and used GesturePoints to input my x,y coordinate pair.
This functionality did exist previously (not sure if it still does, or if this project is open source) in the 'Eye's Free' product, which is designed to aid vision impaired users.
Your best bet is to use functionality from here is possible.
Source-code repo: https://code.google.com/p/eyes-free/
Blog: http://eyes-free.blogspot.com/
Search for TV Raman - he is\was the lead developer for this project
I think this is the specific project you are looking for (on Eye's Free source repo): https://code.google.com/p/eyes-free/downloads/detail?name=com.googlecode.eyesfree.inputmethod.latin-v1.1.6.apk&can=2&q=
You could use Android's built-in GestureDetector (http://developer.android.com/reference/android/view/GestureDetector.html). It will recognize shapes stored in a shape dictionary that you can ship with your app. You will have to seed the dictionary (although there may be some pre-defined alphabet dictionaries for free these days, this functionality has been around since API level 1). You can seed the dictionary by using your development environment and a utility to draw and save pre-defined shapes and map them to expected input.
The GestureDetector APIs will give you a probabilistic match between what the detector recognizes vs. what is in the dictionary and you can determine what to do with the input shape.
I have used this before in an old app and it works very well.
Here's another link to the old Android Dev docs for it: http://docs.huihoo.com/android/2.1/resources/articles/gestures.html

loading google maps data into searchable data structure

For my CS bachelors I am doing a Senior project using android and google maps.
My vision was to do a (relatively) simple Dijkstra shortest path using google maps road data. I was going to add elevation change along with 2D distance. I am doing well playing with maps in android but I am completely stumped trying to access google maps data in any sort of searchable form.
How would I go about accessing the data for say intersections of roads (lat/long) in a particular area?
There has to be a way to pull that data in some sort of tree form. It seems like it may be possible with kml?
Any pointers would be awesome.
I want my paths to follow roads but If i cant this is going to turn into an orienteering application fairly fast.
Jeff
You might want to look into http://www.openstreetmap.org/ instead, they have the lat/long points of streets available for view. Google and others buy theirs, which keeps you from being allowed to access the raw information.
I don't believe you can access raw road data from Google Maps (such information is very valuable - if Google gave it out for free I can see car navigation companies going bust!). The best you can do is get the end result.

Categories