Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 20-03-2011, 17:44   #16
Registered User
 
theway's Avatar

Join Date: Sep 2010
Location: San Francisco, CA
Boat: 1980 Pearson 323 - 34ft LOA
Posts: 641
Re: Porting to Android

I do some android dev, and might be able to help out a bit. I dont really understand the question you are asking about projection though?

Map projection as in one of these? or some other type?
http://geology.isu.edu/geostac/Field...rojections.jpg

Can you give more specifics about the problem?
What classes are you using to parse the maps?
What are the options for the projection?
Can you post an example for us to look at? A visual example or diagram maybe
What do the object coordinates look like?
Why do they need to be transfered to meters?

austin
theway is offline   Reply With Quote
Old 21-03-2011, 01:08   #17
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,537
Re: Porting to Android

Quote:
Originally Posted by brak View Post
I beg to differ. wxWidgets on MacOS is quite stable and we are using it successfully.
Interesting, would you like to point me to a version e.g. of PolarCOM or PolarView in 64-bit Cocoa? I have not found any and also Xgate is 32-bit only.
CarCode is offline   Reply With Quote
Old 21-03-2011, 04:25   #18
Registered User

Join Date: Mar 2011
Location: Vladivostok, Russia
Posts: 7
Re: Porting to Android

Quote:
Originally Posted by theway View Post
Map projection as in one of these? or some other type?
http://geology.isu.edu/geostac/Field...rojections.jpg
Yes. I think that it's Mercator Projection.

Quote:
Originally Posted by theway View Post
Can you give more specifics about the problem?
What classes are you using to parse the maps?
I use self made classes to decode and parse the maps.

Quote:
Originally Posted by theway View Post
What are the options for the projection?
Can you post an example for us to look at? A visual example or diagram maybe
What do the object coordinates look like?
Why do they need to be transfered to meters?
austin
The corner coordinates of the example map is:
East: min 14694750.824210782, max 14731858.775512272
North: min 5312180.795461461, max 5363057.936415557
Scale is 7500 (G in CM93/2 thermenology)
As I know a true horisontal scale of Mercator map depens on latitude of a central point. In this example the distance between eastern and western corner of the map is (14731858.775512272-14694750.824210782)/K, where K depends on latitude of the center of the map. I need to know K to convert distances between points to meters and then into screen coordinates.
I know width and height of the screen in pixels. Also I know true PPI of the device screen, requested map scale on the screen and geografical coordinates of screen center (from GPS). Then Iwill convert the mercator coordinates of the objects from the map file into the screen coordinates and draw it to the screen.

Convertion from map coordinates to lat/lon can be done by this equations:
lon = valx / (DEGREE * CM93_semimajor_axis_meters)
lat =
(2.0 *atan(exp(valy/
CM93_semimajor_axis_meters)) - PI/2.) / DEGREE

where DEGREE = PI/180 and CM93_semimajor_axis_meters=
6378388.0

Equations from OpenCPN sourcecode.
herbeck is offline   Reply With Quote
Old 21-03-2011, 23:37   #19
Registered User

Join Date: Mar 2010
Location: Svanesund, Orust, Sweden
Boat: Forgus 31
Posts: 96
Send a message via Skype™ to balp
Re: Porting to Android

Quote:
Originally Posted by brak View Post
I beg to differ. wxWidgets on MacOS is quite stable and we are using it successfully.
It have no stable support for snow leopard, yet.
There are issues with the classes in 2.8 advances features bug out, it renders things strange and some functions plain and simple crashes on MacOS while they work as intended on Linux and Windows. How ever it's possible to make stable applications that don't run 64 bit and used a limited subset of wxWidgets on Mac OS.

wxWidgets on MacOS have some issues, The latest stable don't even compile out of the box on Snow Leopard. I don't think that's is "quite" stable.
balp is offline   Reply With Quote
Old 22-03-2011, 17:40   #20
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,387
Re: Porting to Android

herbeck....

An ambitious project, without doubt.

Before going too far, please consider the licensing issues.
The Apache license is not compatible with GPL V2, which OpenCPN uses.

If you distribute or publish any program or code with embedded OpenCPN algorithms or code, then your entire project will "become" GPL V2, automatically.

You may not want this. Remember Linksys/linux router box problem?

So, think about the licensing beforehand, and good luck to you.
Dave
bdbcat is offline   Reply With Quote
Old 22-03-2011, 17:47   #21
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,387
Re: Porting to Android

herbeck....

Technical:

The coordinates fetched from the cm93 database are Mercator projected northing/easting from a specified reference point. The dimensions/units are in metres. Think of a a very huge paper map, scale = unity.

To draw on a smaller mercator computer screen, you simply need a linear transform:

y:
y_screen = (cm93_northing - offset) * scale_factor.

Dave
bdbcat is offline   Reply With Quote
Old 22-03-2011, 22:04   #22
Sponsoring Vendor
 
brak's Avatar

Community Sponsor
Cruisers Forum Supporter

Join Date: Jan 2009
Location: East of West
Posts: 252
Re: Porting to Android

Quote:
Originally Posted by balp View Post
It have no stable support for snow leopard, yet.
There are issues with the classes in 2.8 advances features bug out, it renders things strange and some functions plain and simple crashes on MacOS while they work as intended on Linux and Windows. How ever it's possible to make stable applications that don't run 64 bit and used a limited subset of wxWidgets on Mac OS.

wxWidgets on MacOS have some issues, The latest stable don't even compile out of the box on Snow Leopard. I don't think that's is "quite" stable.
I am sorry, but you are wrong. We build on Snow Leopard all the time (we do build with 10.4 SDK but that's done for backwards compatibility). wxWidgets 2.8 is quite stable on a Mac and works well.

Current 2.9 svn tree is not quite fully baked (too bad, because I'd like to switch to it) but it is getting better.

That said, I'd like to note that wxWidgets is primarily a UI framework and should, ideally, be used as such. Using it for more than that, imho, is sub-optimal and will probably create issues down the road.

Anyway, that has nothing to do with Android. Until such day as Google decides to provide Android with a native (i.e. accessible from C) user interface, there is no option for wxWidgets on it and no need for it either.

And because of how different UI and interaction is on mobile devices from non-mobile, it probably wouldn't help even if it was available.

[sopabox on]
I think one important aspect of starting a new project is to evaluate your "core technologies", building blocks for what you'd be doing. These are the things you carefully pick so that they can take you forward far enough without limiting too much what you do and with understanding that you will have to stick to them, the further you go. Because of that, it's always a good idea to not put all your eggs in one basket, and build on 2-3 core technologies (or a dozen, if you can afford it) so they can be gradually replaced or changed. If you center your project on a single technology/library/toolkit it becomes dependent and difficult to move elsewhere. [soapbox off]
__________________
Polar Navy - because life is too short to use ugly navigation software
brak is offline   Reply With Quote
Old 23-03-2011, 20:51   #23
Registered User

Join Date: Mar 2011
Location: Vladivostok, Russia
Posts: 7
Re: Porting to Android

Quote:
Originally Posted by bdbcat View Post
herbeck....
If you distribute or publish any program or code with embedded OpenCPN algorithms or code, then your entire project will "become" GPL V2, automatically.

You may not want this. Remember Linksys/linux router box problem?

So, think about the licensing beforehand, and good luck to you.
Dave
Thank you for information about license issues. The program will be released under GPL V2
herbeck is offline   Reply With Quote
Old 23-03-2011, 21:02   #24
Registered User

Join Date: Mar 2011
Location: Vladivostok, Russia
Posts: 7
Re: Porting to Android

Quote:
Originally Posted by bdbcat View Post
herbeck....

Technical:

The coordinates fetched from the cm93 database are Mercator projected northing/easting from a specified reference point. The dimensions/units are in metres. Think of a a very huge paper map, scale = unity.

To draw on a smaller mercator computer screen, you simply need a linear transform:

y:
y_screen = (cm93_northing - offset) * scale_factor.

Dave
"offset" is the northing_min from the header of the map cell?
As I see in the OpenCPN sourcecode, you use projection of a sphere (not geoid) to cillinder to count lat,lon coordinates. Have you assessed inaccuracy of this method?
herbeck is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Android Port ? sam_uk OpenCPN 34 22-11-2011 00:10
OpenCPN and Android frapip OpenCPN 0 08-02-2011 10:26
OpenCPN and Androïd Okamaugo OpenCPN 10 13-01-2011 23:02
OpenCPN on Android ? ckgreenman OpenCPN 5 15-10-2010 06:54

Advertise Here


All times are GMT -7. The time now is 04:22.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.