[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

General question about GIS mapping in Android

Posted on 2012-09-06
9
Medium Priority
?
622 Views
Last Modified: 2012-09-18
Hi,
I have a spatial database that has objects in Blob format but can also output SVG format. SVG is not particularly efficient however.

I am developing a simple mapping application. What I am wondering is how do GIS mapping applications, map their objects. I am not after a full blown GIS, I am just after a portion of the functionality.

Breaking it down, can I map from blob format instead of svg? Can I select an object, get it to highlight and give attribute information?

If so where would a good starting point be to start developing this?

Regards Hank
0
Comment
Question by:AssetFX
  • 5
  • 4
9 Comments
 
LVL 2

Expert Comment

by:ddurgaprasad
ID: 38371489
In order to help you ,please provide the below clarifications..

1)Is the Blob a Raster (geotiff,img,jpeg etc) file or a Vector(.shp,geodatabase,dgn,svg) format?
2)Does the spatial data has any co-ordinate system(lat/long,UTM etc) associated with it ?
3)Which spatial database are you using ? SQlite/PostGres/MySql...?


Selection,highlighting,providing attribute information  is possible only with Vector type data.
0
 

Author Comment

by:AssetFX
ID: 38371588
Hi,
1. I'm only guessing here but it will be spatial information of the object itself, more than likely a vector format.
2. Yes the spatial data has a co-ordinate system, at the moment it is set to SRID 4326 lat/long.
3. Spatialite which is SQLite extended.

Hopefully this gives you a little background.
0
 
LVL 2

Expert Comment

by:ddurgaprasad
ID: 38372804
AssetFX

Answers 2,3 are useful to certain extent.

You can quickly check Answer 1 : If you are able to perform export to shapefile as described in below link,tt would be certainly Vector format.That will make your job easier.

http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/impexp.html
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AssetFX
ID: 38374507
Hi ddurgaprasad,

yes you can export to a shapefile. And the breakdown on the blob is documented here Internal BLOB format

I can see the end picture of what I want, mapping the objects, I am still confused as to how to get there.

So I now know that it holds vector data and what kind of format the blob data is in. What are my next steps?
0
 
LVL 2

Accepted Solution

by:
ddurgaprasad earned 2000 total points
ID: 38378845
AssetFX

Now that we know that the map is in Vector format,we need to do the following things.

1)Parse the vector data from BLOB

      (a)  Get the extent of map from MBR_MIN_X,MBR_MIN_Y,MBR_MAX_X,MBR_MAX_Y
      (b)  Get the CLASS TYPE
      (c)  Get the x/long,y/lat coordinates of Polygon(OR Line,Point)

2)Set the Drawing extent on the device using (a) above;Draw Polygons/Lines/Points whithin this extent.You may use Graphics libraries like OpenGL, Direct X,GDI Plus etc to draw these objects.

3) Provide the user with Mouse click option to select map elements like Polygons.
Change the color(highlight) of selected item;Display attribute data for that element.


For 1,2 you could try my sample and improvise upon it to get the desired functionality.
0
 

Author Comment

by:AssetFX
ID: 38381642
Hi Durga,

To add another level of complexity, I am going to be doing this on an Android device, what do you suggest is the best way to proceed with the above?

Kind Regards AssetFX
0
 
LVL 2

Expert Comment

by:ddurgaprasad
ID: 38382432
Hi AssetFX

You Could use OpenGL or any graphics library suitable for your Andriod platform to accomplish all the tasks.Alterantivel this link has an SDK which supports functionality asked by you on Android environment.

Regards
0
 

Author Comment

by:AssetFX
ID: 38385711
Hi Durga,

I will stick with OpenGL. Getting the MBR of each table is straight-forward.

I had a look at your example, it is very fast! Hopefully I can accomplish something similar.

Before I jump in and get the data, I am thinking will be create a set of classes that will hold the data. First a layer class for each table and child classes that define the various shapes as you have done in your example.
I thinking this way I'll be able to turn layers on and off at different zoom levels.

Does that sound about right?
0
 
LVL 2

Expert Comment

by:ddurgaprasad
ID: 38391332
Sounds Good...Give it a try :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I feel like more and more people want to know how to programmatically convert addresses into geospatial locations. So in this article, I will show you how you can do it with Bing Maps. I'm going to use PowerShell, which is a nice scripting language,…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question