Can we use our own map(Like our house map) and then use GPS to show where we are in the map?
If it is possible then how to do it?
You can do anything you want, but if you are asking if there is an easy way to do this, no.
You would have to produce a scale drawing, then map the pixel space to the scale of the image, know what geopoints represented the corners of your map, then project that onto your scaled display image.
Some open source products use tiled images similar to google maps, but they use OSM data, I suppose if you were dedicated you could use that and turn your map into tiles but I would think for your purposes it would be easier to do this your self.
You might check the google code repository etc. and other open source venues and see if anyone has done anything similar to this.
Also the best accuracy you are going to get is about 2m, and certainly not indoors (if you got a signal at all)
Related
I am planning to build sort of a geography quiz app where you have to touch inside the borders of the searched country. So, I have to display a map (I want it to be offline) and be able to test the user click against the map in some way.
I've been searching a while now and found good OSM material from Natural Earth Data and TileMill for converting it to a MBTiles-file (sqlite-database containing all the png's and some meta-data too (using UTFGrid)).
On the Android-side, I would like to use OSMdroid for displaying the maps, mainly because it's open-source and highly maintained.
I've found some guides on how to use the MBTiles-database inside osmdroid but is there also an easy way to access the metadata or check otherwise if the user touched inside the right country area? I would like to avoid some sort of "boundary boxes"...
Any help is highly appreciated!
I'm pretty sure that bounding box calculation is best option.
Can you access metadata from the offline tile source? Yes, kind of. You can get a list of unique tile sources in the archive but that's it. There's an open issue regarding getting the bounds of a given offline archive. You can follow it here (or contribute)
https://github.com/osmdroid/osmdroid/issues/174
It's slightly complex because offline tiles are going to have a bounds per layer/source and per zoom level. There's also no guarantee that that bounds of that given zoom/layer is going to be contiguous. I.E. one zoom level can have both the US and western Europe in it.
Im on my final project in which I would like to build an android app especifically for the university context. Therefore I would like to use geolocation but for matters of detailed information (colors, shapes, buildings, etc) and gamefication I would like to draw my own map and the user should be able to see his position on this map. So I would have this drawn map and I would use the device's location service and transform the coordinates to a position on my map.
I'm kinda lost on this, didn't find much on the web. So I would apreciate if anyone could point me a direction or if anyone could tell me how hard would it be to implement. Would it be as simple as a function Point foo (double lat, double lon);?
Thanks in advance.
Drawing the whole map completely would be rather difficult and would involve loads of extra work, thus I would suggest you an alternative that would allow you to have your own drawings, on top of the already made Map.
You could for example use the groundoverlay, for items that you want to draw yourself. and then use the google maps under it to show the map, and to handle any positioning etc.
I'm trying to create an app that will tell a person what zone of a building they are in. I'm using bluetooth dongles to get an approximate location, as oppose to exact location, and show the user on a map whereabouts they are. I would like it just to highlight the zone they are in, instead of a specific location.
I can get my hands on a floor plan of the building I am using so I'm just wondering if there is an easy way to incorporate this into some kind of map with an existing API? I found a question here which states that they just use an overlay on the image to show a marker of where the person is. Would this be a bit easier?
This is for my final year project so I would like to have some sort of flashy map if possible but I'm not sure where to start looking or if it's possible.
I also found this question which gives a great variety of apps that implement and indoor map, but I don't think I can just take this small piece of functionality that I need out of them as they seem to be complete apps.
Any information would be a great help. Anyone with experience in this sort of thing please share your knowledge :)
It doesn't sound like it'd be too complicated to just write your own custom view for this. Draw the map image to the canvas. Then for the zone the user is in, draw another 'highlight' graphic on top of the map that you just drew.
If you're not sure how to do this, there's a rather basic guide on how to create your own drawable widgets which should point you in the right direction. There are plenty of examples on drawing images to the canvas, eg this one.
I need a Map API for Android that can provide me with indexed nodes and indices that make up the road network. The main idea is to determine if two GPS devices are on the same road. Thank you in advance
A Map API by itself will not have that information. Anyway, you can get it from OpenStreetMap freely. You can download it from here.
I don't understand from your question if you intend on displaying the results on a map. If so, and you want a nice and free map API, I would suggest Leaflet. It's not as mature as the likes of OpenLayers but, as you've tagged this post with "android", Leaflet just kicks ass in the mobile department.
OpenStreetMap is definitely a good source of data for this kind of project. Unlike google maps, it gives developers access to the underlying vector data of a map (fully open). This allows interesting new use cases which simply are not possible with google maps, and something involving geometric calculations like this would definitely fit into that category. You either need OpenStreetMap or some other source of "vector" map data, and beyond OpenStreetMap this can be expensive.
Unfortunately that's not the full answer to your question. You still have a lot of work to do to use the data in the way you intend. You need to calculate the proximity of two points (GPS readings from two devices?) to nearby roads, and figure out which road the point lies closest to. It's the kind of powerful geo calculation you might do using a GIS package such as QGIS or a functions of a geo-aware database system PostGIS.
But that's not the answer to your question, because you need to do these calculations on device. I'm not aware of an off-the-shelf library to do this on android. I think you would have to roll your own.
But another challenge is to get the vector data onto the device in a suitable format in the first place, and this is the first thing to solve. You'd want the vector data either as a large download for a whole country, or perhaps a smaller area, perhaps with an on-the-fly download feature within this app. Whole countries are not infeasible when working with maps in vector form (ever tried the awesome MayDroyd app?), but require some compact formatting. Happily some of these problems are starting to be solved in open source off-the-shelf libraries. You could try to build on top of MapsForge for example.
So then you're back to the challenge of writing on-device code to poke around in this data and do the calculations you want to do. I suppose it could be rather good if projects like MapsForge included generic PostGIS style geo-functions to make this easier. Something to ask the mapsforge developers about perhaps.
My app that I'm working on is mostly informational. I have a MapView setup right now to use MyLocationOverlay to track where the user is. I'm planning on having a list of coordinates for all of the buildings in the area. If a user wants to see where it is on the map, they can open up my dialog, find the building in the list, click it, and have an overlay drawn for it.
I'm not sure the correct way to go about for this. I already know how to create map overlays. Would the best approach be to have a HashMap for latitudes and one for longitudes, and then go out and grab the coordinates manually to store into those maps? By manually I mean having to find the coordinates myself and code them in by hand. If I do this, what is the best way to find them manually? I noticed by poking around in the javascript for Google Maps that there was a lat/lng value for the center of the map, but it would be a pain to do this for 100+ buildings.
Or should I be making a Google Maps query for the building and getting the coordinates for the overlay like that? I have done some searching, but have no clue what to do if this is the best way to do it. I was also thinking that I might run into some query limit by doing it this way rather than having the coordinates programmed directly into my app.
I'm not a beginner with Android or programming, but my data structures knowledge is a bit rusty. Any ideas would be greatly appreciated (maybe I'm approaching the whole thing wrong).