Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Map creation ideas

Status
Not open for further replies.

thumpkidd9

Programmer
Mar 27, 2005
42
US
Hello,

I wanted to try and create a map program and wanted some input about what is a good way of going about it. I want to keep it simple (no zooming or moving) just one static image. I wanted to do something like a grid, that is a person can live in section Col:A Row:10 of the matrix. So my question is should I create a N x N gridLayout and break the image into N squared blocks and place them appropiately.

Thanks,
~mp
 
If you are handling raw map data in chunks like this, then maybe some kind of GridLayout may well be appropriate.
If the map data is derived in some way from non-image data, you'd probably want to 'roll-your-own' map component subclassing JComponent which paints its bit of map directly to the graphics context.

Unless, of course, the map data is actually lots of separate image files. You could probably have a GridLayout constraining JLabel components containing the images as Icon objects.

Maybe a fuller description of your requirements might help someone give you a better suggestion.

Tim
 
There are no requirements so anything is possible. Right now I have 1 picture of my city but I was thinking of seperating it into many pictures in order to lay it out on the grid. An example of its use could be if someone enters a street into a textfield, the place on the map shows a dot or is highlighted or somethign to that effect. I'm not looking for pinpoint accuracy with the map, but maybe just highlight the surrounding area of the entered street(i.e the whole block on grid).
 
That would be one huge image to cover the whole of the area he'd want to cover.

Sedj has experience of mapping software. Sedj? Any suggestions? (Other than write it in C [wink])

Tim
 
I've been avoiding this thread ;)

OK, so you have an image, and it sounds like you want your application to be spatially aware (you said you wanted someone to be able to type in a street name, and the point be highlighted/marked on the map).

This brings into light two questions for me :

1) Which projection and coordinate are you using ? Can you assume a 'flat grid', or do you need to compensate for curvature of the earth ?

2) How are you going to geolocate a street name ? If you have some software (ie an address matcher) which can give you a coordinate for a feature, then how do you plan to plot that coordinate in your virtual map grid (especially in reference to the projection system) ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Because an image of the entire globe to street level would be a teeny bit big?

Tim
 
... even so, I'd imagine an image of a city could be quite large. And if he doesn't want zoom / scroll stuff, how's the user gonna see the indicated road on a full image scaled to fit the viewing window? Chop the image into blocks which show street details at normal viewing sizes.

Tim
 
I think some feedback from the OP might be appropriate at this point...

Tim
 
Ok, sorry for the long delay guys but thanks for your interest. I got backed up with another project and I had to work on that and sort of forgot about this one.

Sedj:
1. You can assume that it is a "flat grid" and
2. I have a House object that has a few fields, some of them being "street", "development", for example. I was planning on adding another field "position" that corresponded to the grid. When the user enters the information of a house for the first time, they will refer to the static image themselves, and enter the cordinate. Its a brute force tactic but after a while all the cordinates should fill up :) I have no idea how to plot the cordinate on the virtual map grid though.

As for the image, the city is relatively small and wont need zooming or scrolling in order to see a street level map

Again sorry for the long wait for a response

~mp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top