www.jpct.net

General => Feedback => Topic started by: Melssj5 on July 10, 2007, 02:30:47 am

Title: using JPCT for cartography!
Post by: Melssj5 on July 10, 2007, 02:30:47 am
Hi, I  must do an own "google maps" system from 0, no maps, no tools, no nothing.  >:( >:( >:(

I was thinking on using jpct for loading the maps but I am worried about the memory becausse they would be huge (a city map) but I could use many of their advantages like getting names from the objects, rendering, the interact2D methods, being able to mark points, java based and trace a route. I guess I might use jpct for this but I am afraid becausse I must do it fast and well, but I got too many requirement and 0 resources for that. I have been looking for GIS tools but I have had not luck with it.

If anyone knows how can I do a mini google maps for tracking vehicles, tracing routes, showing address info, etc etc etc, please tell me becausse I really really need it!  :'( :'( :'(
Title: Re: using JPCT for cartography!
Post by: cyberkilla on July 10, 2007, 04:13:45 am
There is no way you can pull that out of thin air:P

You'll have trouble with coordinates, scale, and all sorts :D
Title: Re: using JPCT for cartography!
Post by: hytparadisee on July 10, 2007, 04:53:56 am
Just on the news section yesterday from www.java.net

This one might be what you are looking for.

java world wind SDK from NASA

http://worldwind.arc.nasa.gov/java/
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 10, 2007, 04:20:14 pm
There is no way you can pull that out of thin air:P

You'll have trouble with coordinates, scale, and all sorts :D

Why? Once I have a good map, I just need to define 3 point of reference then I could reach any other position!
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 10, 2007, 04:27:50 pm
I have seen world wind but its just satellite view as google earth o google maps on the satellital view, but I need to get the street names and draw a route over the streets. Any idea about that?
Title: Re: using JPCT for cartography!
Post by: EgonOlsen on July 10, 2007, 05:58:12 pm
How huge would that city map be?
Title: Re: using JPCT for cartography!
Post by: cyberkilla on July 10, 2007, 06:02:37 pm
Sorry for sounding defeatist there:).

It is possible, but what I meant was that it will take time to make something like that.
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 10, 2007, 06:11:59 pm
How huge would that city map be?

thinking it well, it wount be so huge. The project is to track vehicles on Columbia! (All th country), especially on Bogota, Cali, and the main cities. A street is not heavy, just a beveled polygon, so the map wont be that heavy thinking well. I guess jpct is a very good technology for use in cartography! Now I am trying to buy a dwf map of Bogota to test it, but the problem is that the map seller is on Columbia and me in Ecuador! Is any one has a dwf or dwg map of the streets of any city please  :-[ give it to me for testing.
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 11, 2007, 05:58:31 am
Well, I tried first to create the 3ds file using 3d studio max, but my PC died trying to work with the map. I guess is on real scale, more than a million of square relative units.
Title: Re: using JPCT for cartography!
Post by: EgonOlsen on July 11, 2007, 02:45:50 pm
Sounds huge...with enough RAM, it should be loadable. Processing it will take some time, but after building it and creating an octree, you may serialize it, which is much faster to load. If only a small section is being rendered, it might work...
However, this is all guessing. I've never tried how jPCT behaves with such huge objects.
Title: Re: using JPCT for cartography!
Post by: cyberkilla on July 11, 2007, 04:12:09 pm
Is it possible to load it into something like Blender, and use its "Simplify" tool?

It will merge similar polygons, reducing the polycount, but not affecting the quality too much - depending on the zoom level you are intending to use.
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 11, 2007, 05:07:24 pm
well, the map is on dwf format (1.9MB), but after the convertion to DWG or DXF it went to 9 MB, I guess they have many stuff that make it big. Once I got an autocad model of 3.2 MB and after deleting things like tress and gardens it went to 300 KB. I wante to do that firstly but my PC werent able to do it!
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 13, 2007, 06:05:23 pm
so, what about this:

1.- getting a jpg or bmp of the city at a good resolution!; maybe 3000x3000

2.- draw lines in Autocad over the main streets

   2.1.- Defining one set of roads for each way (north, south, east, west)

3.- each line may have a different name for example: "n|Amazonas" for Amazonas avenue going to north

4.- Use a plane of the same dimmensions of the image map

5.- merge the lines drawed with the plane making it fit.

6.- export it as 3ds and pass it to jpct.

Any suggestions? This would only work for the main streets becausse I will be helped by an architect friend. So I cant expect him to draw thousands of streets and putting names to them.
Title: Re: using JPCT for cartography!
Post by: halcor on July 16, 2007, 01:56:59 pm
I think using jpct for drawing 2d raster map and some vector data over it (if I understand correctly your needs) is overkill. Basicly, at any moment, you have position, rotation and scale of the map, right? So, assuming you stick to the standard Java MVC pattern you need to design and implement:
1. MODEL - a way to load and represent vector data (doesn't matter if it comes from AutoCad or from some other source) over raster data
2. VIEW - a way to display data in it's current state (position, rotation, scale)
3. CONTROLLER - a way to interact with the user and let him change position, scale, rotation

A site with many java GIS projects with source for inspiration:
http://opensourcegis.org/

On the other hand jpct can display textured planes (scaled and rotated raster data) and wireframe meshes (scaled and rotated vector data)... out of ideas here, but hope I helped a little :)
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 16, 2007, 07:49:02 pm
In fact, no. But thanks a lot anyway. I am running out of ideas. I will try to make a basic thing with jpct and will post the results.
Title: Re: using JPCT for cartography!
Post by: Remo on July 18, 2007, 04:33:31 am
I've worked a little bit on a real time system for tracking vehicles on a map. We did not use any 3D stuff in it. The whole path and weight data was on another tracking system (It has dynamic weight on the paths due to traffic and road blocks etc.). We pulled the real time data from there and just adjusted cropped image maps of the place so we had the references all set. We loaded at least 8 map units to surround the zoomed area and make zooming faster.
The path algorithms used were 9 custom and 2 standar ones to check for errors etc. ( the ones you can see in books like Dijkstra, etc.).
One of the hard parts was getting the roads to work like roads ( Meaning there's road data rather than trying to get gps position over the map) and mixing it up with terrain and whatever other entities you have there.

We managed the memory by cropping a map (square area) and adding road data (array of nodes array to get road directions and finding where roads meet and with coord data) and serializing that whole thing as a map unit and we rendered that unit and the surrounding ones (8).

We had different resolutions for the maps because sometimes it was needed to zoom a huge area so we built same size maps with much more area and data in it and we serialized again. So when you zoomed out too much most map data was already in place all was neede was to load more data from the other system.
Of course this was a huge machine running it. And the rendering was done apart from the processing.

I really don't see any benefit for using jPCT here thought.

And you do need to get some good maps of the area you will use and work it from there.
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 18, 2007, 05:04:05 am
but, how could you get the names of the streets on which the car is placed and what about drawing a route for some other points.
Title: Re: using JPCT for cartography!
Post by: Remo on July 18, 2007, 11:28:34 am
We got the position and our application already had names on the streets as we built the map units. Every map unit has part or an entire street which name we already set on the map unit so that was not hard.
We compare the object position with an area in the map (the street, because we already know where the street is since we know some places on the map are static and we know their position, it is defined in the map unit) and just get the street name, kinda like collision detection.
Part of the street database came from some sort of weird GPS/GIS mix system. Some other data was missing and we had to get the data on our own.
We built a tool for making map units, so we had the images and a guy programmed the tool to take road data from another version of the same image used to build the map unit but with roads overlapped. Then we got some dudes to insert the street names by hand with a tool they could click the street on the map, then check on a map (the kind of map the gov has in paper) and set the street name, and we got street data up to date and the way we needed it.
Since we have all the roads and road connections we can use that data to find routes, etc. we built some custom algorithms because we had more requirements than "find the shortest path" but it's kinda the same idea. Then drawing the result was easy because we knew where to draw every point in the map, and if we were using streets we just used the street data from the map unit.
Title: Re: using JPCT for cartography!
Post by: Melssj5 on July 18, 2007, 08:34:51 pm
ok I guess I have an idea about that, but which kind of maps do you use, I mean, on which format? Do you know is that app can be bought!?
Title: Re: using JPCT for cartography!
Post by: Remo on July 19, 2007, 12:00:30 am
Used a custom map format. I don't know much about it because I didn't work on getting the map data into the app.
And the application is not for sale sorry :(.
Title: Re: using JPCT for cartography!
Post by: Remo on July 21, 2007, 12:13:58 am
Ok talked to the guy he said they used something similar to this for some of the processing:

http://www.ittvis.com/envi/envi_in_gis.asp