Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-22-2010, 08:06 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
alobar72 is on a distinguished road
Default 2D OpenGL Map using GEO coordinates

Hi all,
I am totally New to OpenGL... Saw some of the Videos, Read some Blogs and so but i still can't get I real start for what I'm planning to do.
So a little kickstart on how to approach this would be great.

I want to basically draw a 2d map using parts of openstreetmap data.
But I don't now how to get started. How I should setup the corrdinate systems and so on.
I know this is a bit vague... Maybe someone can help anyway.

Thanks in advance.
alobar72 is offline   Reply With Quote
Old 12-22-2010, 09:30 AM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by alobar72 View Post
Hi all,
I am totally New to OpenGL... Saw some of the Videos, Read some Blogs and so but i still can't get I real start for what I'm planning to do.
So a little kickstart on how to approach this would be great.

I want to basically draw a 2d map using parts of openstreetmap data.
But I don't now how to get started. How I should setup the corrdinate systems and so on.
I know this is a bit vague... Maybe someone can help anyway.

Thanks in advance.
Hoo boy. OpenGL is a big subject, and so is mapping.

Most people use the map kit that's included in iOS rather than trying to roll their own mapping system. You have a big, big job ahead of you trying to write your own mapping system.


First, mapping.

Mapping uses lat/long coordinates, which describe positions on a spherical object (the earth.)

In order to plot a lat/long onto a 2D surface, you have to use some projection. Mercator projection is the most commonly used, but by no means the only option, and not necessarily the best. You need to do a bunch of math on lat-longs in order to project them from spherical coordinates to 2D coordinates. See the link I posted to get you started.

You'll then need to take your open street maps data and render it into OpenGL, probably using an orthographic (non-perspective) projection.

I used the OpenGL Superbible when I was first learning OpenGL. That was on the Mac, not iOS. The OpenGL Superbible is about 1200 pages long, and WAY, WAAAAAAYYYY more then I can cover in an online post. You might want to buy a book on Open GL ES for the iPhone. I bet there are several good ones by now.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 12-23-2010, 01:25 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
alobar72 is on a distinguished road
Default

Hi,
Thanks a lot. This gives me something to start from.
Best regards

Quote:
Originally Posted by Duncan C View Post
Hoo boy. OpenGL is a big subject, and so is mapping.

Most people use the map kit that's included in iOS rather than trying to roll their own mapping system. You have a big, big job ahead of you trying to write your own mapping system.


First, mapping.

Mapping uses lat/long coordinates, which describe positions on a spherical object (the earth.)

In order to plot a lat/long onto a 2D surface, you have to use some projection. Mercator projection is the most commonly used, but by no means the only option, and not necessarily the best. You need to do a bunch of math on lat-longs in order to project them from spherical coordinates to 2D coordinates. See the link I posted to get you started.

You'll then need to take your open street maps data and render it into OpenGL, probably using an orthographic (non-perspective) projection.

I used the OpenGL Superbible when I was first learning OpenGL. That was on the Mac, not iOS. The OpenGL Superbible is about 1200 pages long, and WAY, WAAAAAAYYYY more then I can cover in an online post. You might want to buy a book on Open GL ES for the iPhone. I bet there are several good ones by now.
alobar72 is offline   Reply With Quote
Reply

Bookmarks

Tags
opengl, openstreetmap

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 395
9 members and 386 guests
chemistry, daudrizek, HemiMG, jeroenkeij, Kirkout, PavelMik, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:00 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0