Android Custom Tile Map - android

I'm working on a project that requires a custom tile map of a building to be displayed along with up to several hundred "points" to be plotted as objects within the building, all on one or more mobile platforms (Android to start).
There were two ways I thought of to tackle this issue. One was to use osmdroid or mapsforge to display a zoom-able tile map. One issue I've had with this, however, is that I haven't been able to locate the software to automatically split up the single image into the correct tile format. MapTiler has worked fairly well, except my Y axis tiles are all upside down.
The second was to display the entire image as an imageview, and then write the code to display the points of interest on the map as the image view is scrolled around. However, I'm not quite sure how I would go about drawing an undefined amount of images on top of an image already displayed in an image view.
Does anyone have any ideas or might they be able to point me in the correct direction?

You can use http://code.google.com/p/gheat/ and put the tiles from your server in your android app.

Related

how to autocrop business card images taken from camera using opencv in android

I am developing an app that captures a business card using custom android camera and then i need to autocrop the unwanted space in android and then store the image . I am using opencv for this. All examples i am seeing are in python . I need it in android native.
You can probably try something like this:
1) Get an edge map of the image (perform edge detection)
2) Find contours on the edge map. The outermost contour should correspond to the boundaries of your business card. (under assumption that the business card image is against a solid background) This will help you extract the business card from the image.
3) Once extracted you can store the image separately without the unwanted space.
OpenCV will help you with points 1,2 and 3. Use something like a cannyedge detection for point 1. The findContours function will come in handy for point 2. Point 3 is basic image manipulation which I guess you don't need help with.
This might not be the most precise answer out there - but neither is the question is very precise - so, i guess it is alright.

Best way to deal with big (shape-)data for map in Android Application

I am building the prototype for an Android app that should result in a versatile map that can deal with a large but static amount of environmental data combined with (user-generated) data that will be hosted on a separate platform.
My current approach is to fetch the large static data via Google Fusion Tables (in original a shape file - .shp, .dbf, .shx that I have exported as a .kml with QGisMaps - the "smaller" .kml I am using is already 66.4MB, the one intended for final use over 140 MB...) I know it is possible to slice down .kml but will this have an effect on loading times?
You can see a current example of the shape data on Google Maps here https://www.google.com/fusiontables/DataSource?snapid=S717313eWaJ
But now I am wondering if I am on the right path at all since this one layer of data is loading very slowly on my machine and I am not aware of the hassle to put this map into an Android app - and more importantly also fetching more data from a separate server and putting it as another (filterable) layer on top of it. This layer will be collected data from users, thus not "static" but regularly updated - integer values displayed in color per geodata.
Several people hinted me to use Open Street Maps but some advised that Android is very eloquent with Google Maps - in the middle of development I thought maybe someone can tell me whether I chose the right direction to go for or are most likely facing less problems with an alternative solution.
I would be really glad if someone could advise me on the issue with combining map data from two different sources layerd onto one map in Android whereas one bunch of data is huge but static and the other user-generated values.
Thanks so much for your time and looking over this
best
Birgit
EDIT #1: I am now switching to Open Street Maps, hoping to be able to set up a GeoServer myself hosting the data and querying the WMS with the App. It seems like the size of the data still has to be compressed in some way, I will keep you updated.
I'll not be able to address all of your concernes, but I can share some of my experience with maps and ovelays.
The most important concept you must be aware is the memory heap. Each android application has a maximum memory amount that can be used to allocate data objects, called memory heap. This limit is different from device to device and can go from 16MB in small older devices to 64MB in new tablets.
Having said that, you will never be able to load all your data at one shot if the data structure required to hold it exceeds the maximum heap available for the application.
Also, usaging large amounts of memory makes your application better candidate to be terminated by users or by the SO when additional memory is required by critical activities (like a phone call).
Now, going to the maps part...
I've used Google maps as well as mapsforge api for OpenStreet maps. Google maps requires internet connection, while mapsforge enables you to use a local map file or online connection. OpenStree maps don't provide the sattelite view.
Regarding performance, online connection tends to be faster, as they download already rendered map images, while offline map requires the images to be rendered as needed. Mapforges can use a local cache to improve this a little.
Displaying Overlays:
I've used both API's to display paths with arround 10.000 points over a map, together with additional overlays (compass, scale bar, pop-ups, etc.) and the code runs smoothly in a mid-rande device. However, my code have some optimizations to reduce recreation of paths (when user zoom or move map) by transforming the already existing path.
good luck.
So this is how I eventually converted a .shp file into a format that could be displayed by OSMdroid's XYTilesource.
I exported the layers separately as .kml projected WGS84 and imported them as layers to TileMill. After having defied the colors for each layer in CSS, I exported my map as a set of MBTiles. I uploaded them to Mapbox.com. From there I can fetch the tiles which are in the format a.tiles.mapbox.com/v3/myUsername.myTiles/{z}/{x}/{y}.png in my OSMdroid Mapview.
final myTileSource tileSource = new XYTileSource("myTiles", null, 10, 16, 256, ".png", "http://a.tiles.mapbox.com/v3/myUserName.myTiles/");

Placing an draggable image onto PDF in Android

Here is my problem:
I need to create an interface, where a user could see a low-quality version of a PDF page, and choose a place to drop a small image onto. After that, I need to get the page number and the coordinates of the top-left corner and the bottom-right corner. I also need to make sure, that there is no way to move the image outside of the PDF.
What I could come up on my own, was to somehow convert the PDF to a bunch of images, which I could then show, and change pages, by just loading the image for the next page. And I could then create some sort of draggable on top of that, and read the coordinates.
So could anyone tell me how to get this done?
As a bonus, could someone help me with some tutorials, links and the sort, to resources that could help me with this?
From where I stand, this could be VERY interesting, but also very resource intensive, since the PDF's should be converted on the fly. Can it be done page by page?
Some technical specs:
Max file size - 4Mb, so the PDF wouldn't be awfully big
Min API - 8. I need it to work on Android 2.2
Ok, I've tried this out, and it all comes grinding to a halt on the PDF to image conversion, which with Open-source libraries takes about 10s for each page, making this a Non-option. A hat tip to Adobe for making it so fast with their app.

Osmdroid: How I can create and load a map from my own bitmaps(tiles)?

I am starting to use Osmdroid and I would like to use this technology for showing a map about an F1 circuit. I have a big picture and I can cut it up to divide it into smaller tiles.
Can I modify the osmdroid library for the upload of these pictures?
I would like to save these bitmaps (tiles) in my assets folder.
I am pretty lost on how to do this.
I am using this way because android, normally, gives a memory error when I try show this complete full-size picture. If I only show some tiles of the image (depends of the zoom) maybe my app would work better?
Thanks in advance!
Osmdroid uses a system in which world map is divided into tiles. Tiles usually have the same pixel size which means that the bigger zoom level you use the more tiles are needed to "cover the world". Each tile has its coordinates (x,y) and a zoom level in which it is designed to be used.
It is possible to use various custom tile sources in osmdroid. Take a look at this class in osmdroid - it creates instances of some tile sources. You can create your own tile sources using the same mechanism. However, all this uses these x,y coordinates of the world I described above. Osmdroid will ask your tile source for example for tile 10,10 in zoom level 10. If you are able to create tiles of your map to work with this coordinates system then it will work. However, it may be hard to do this for custom maps such as F1 circuits.
I am also interested in this and probably will try to use tiling mechanism of osmdroid to display some big images in the near future. If you succeed in this please let me know:).
I think there's two questions here:
How to create osmdroid format map tiles from a bitmap file.
How to load them into osmdroid
For question 1 you can use a tool to create your tiles.
http://www.maptiler.org/
Can be used to create tiles from a bitmap giving in your bitmap and its boundaries coordinates.
http://mobac.sourceforge.net/
Creates Atlas from online maps, it can create osmdroid zip atlas. Not sure if you could use it to create your osmdroid zip format.
If Mobile Atlas creator doesn't help perhaps you can create the zip manually if your source bitmap is not too big.
For question 2:
I extended an osmdroid class to deploy maps in an apk using the asset folder. See here:
https://stackoverflow.com/a/14832770/891479

Image OCR Android

I am working on an android application in which I have to perform OCR from an Image. For example if I have drawing of building, user clicks on a particular area on the image (like Kitchen or Parking lot), after that click I want the location name/number where the user have clicked. This number will be present in that location.
in the given image if i click on Lecture Room part then the application must detect the area where I have clicked and give me the name (i.e. Lecture Room) for further queries..
Please help me out. I have tested many applications but most of them detects words not the drawing images.
Edit
It is just like HTML Image Maping
Interesting project, I've been developing an Android app with OCR and I included useful information and a code example in the next post, have a look at it and if you have any question, just ping me:
https://solidgeargroup.com/ocr-on-android
I'd say that you need to work on how you have abstracted your problem, if the goal of the application is to read any image file and extract all the text from it in order to make it searchable, you've got quite a project ahead of you.
However, if your goal is to make a finite number of maps clickable, I'd say that you should create a table of all the known locations in each image and then save the coordinate where the user clicked. That way you can look up that coordinate in your table of known locations and present the corresponding room to the user. A room could for instance be defined by the coordinates of its northwest corner and its southeast corner. Determining whether or not a coordinate is within those boundaries is trivial.
If your application really requires OCR you are in a world of trouble I'm afraid.
Edit: minor mistakes edited out.

Categories

Resources