Mapping

ceaser

Active Member
Licensed User
Hi Klaus:sign0188:

Thanks for the sample on the mapping routine. Here is what I am looking for:

1. Load a map like in your sample.
2. Georefernce the map by tapping on 2 positions and entering the coordinates or the lats and longs.
3. Have zoom functions like in your other map sample.
4. Have basic drawing functions like a line, circle, etc.
5. Be able to plot bitmaps (like a car, etc.)
6. Connect a GPS which shows the position on the map and can plot your path as you move along.
7. Be able to store the path of your movement.

:sign0085::sign0085:

Thanks
Ceaser
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

I will add the functionalities you need.
1) already done
2) no problem
3) no problem
4) partially done, do you need also drawing texts?
5) no problem, alraedy done in another program
6) 7) I don't have a GPS, so I won't be able to do it.
But it shouldn't be that complicated, I remember that alea46 on the french form has done someting in that direction.

Would you like me to continue with the ScaledMap program or would you like having it directly integrated in some of your code.
My suggstion is to move the ScaledMap code in a module so it would be relatively easy to integrate it in your code.

Best regards.
 

ceaser

Active Member
Licensed User
Hi Klaus

I don't believe it! You guys are the most helpfull people I have ever met in my 20 years of programming.:sign0188:

Klaus, if you can put the code in a module, then it will be easier to incoporate the code in my program.

I think we should discuss payment for your help!

Thank you very much
Michael:sign0188:
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

I have some more questions:
- What size, in pixels, are your map images ?
- What depth of zoom are you thinking of, this would or could depend on the image size ?
- Do you want the lines, circles and bitmaps directly been drawn onto the map image or onto the forelayer ? With the forelayer I am afraid that it would be complicated to combine both images afterwards.
- For the circles do you want to draw them with a given radius or do you want to determine the radius with the stylus rubberband style: point center- move for radius release draw. In that case, also for the lines, we must forget drawing onto the forelayer.

That's enough questions for the moment, will come back if there are other ones.

Best regards.
 

ceaser

Active Member
Licensed User
Hi Klaus

With regards to the pixel size of the map, this will depend on the type of map one will be loading and this will also have an influence on the zoom factor.

With the drawing functions can one not have an input box at the bottom or top of the screen where one can enter the parameters of the line or circle? For a line one will type in say 10,20,30,40 (startX, startY,endX,endY) and for a circle say 10,20,4 (centerX, centerY, radius). In this way the user can either draw with the stylus on the screen (and the parameters appear also in the input box) or type in the parameters.

Regarding the layer on which one draws or the path that gets plotted from data received from the GPS, can one not store this in a database so that the orginal map stays intact? One could then be able to load different "Data Files" which could then be plotted as an overlay on the map.

The database could be structured as follows:

L,10,20,30,40,cRed...................line
C,10,20,4,0,cBlue.....................circle
P,10,20,0,0,cBlue.....................point
.........etc.

Klaus, thank you very much for your help:sign0188:

Thanks
Michael
(a german in Africa!!)
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,
I have been continuing the program, exactly in the same direction as described in your post.
I will post a sample quite soon to make shure that it fits your needs, requirements and feeling.
Are the maps, always oriented north-south or can those have an angular orientation? If yes that means we need 3 points to scale the maps.
The map I included in the first version is a screen copy of Google Earth, and there there can be an angular orientations.

Best regards.
 

ceaser

Active Member
Licensed User
Hi Klaus

You are right, it is a good idea to georeference the map by specifying 3 points on the map just in case it is not orientated in a north-south direction.

Something one can also incoporate at a later stage is a "correction" that can be applied in case there is a scale error in the points that were used to georeference the maps.

Klaus thanks again for your help.:sign0188:

Regards
Michael
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

Here is a first version of what the Map program could look like.
There remains of course functionalities to add and a lot to test.
I have not yet tested so much, but I would like first to have your feedback if it fits your needs, requirements and feelings.

What can be done:
- The map is at the moment fixed.
- The map can be scaled.
- Drawings can be made onto the map:
- Polylines, circles, texts and bitmaps.
For the circles, the radius can be defined (in pixels)
For the texts, those can be input.
The colors are selectable.
For the bitmaps, just two images are predifined in the program at the moment.
- Select any element of the drawing, no modifications possible yet, just the color.
- The scaling of the map needs more testing.
- Save and load drawings.
The saved data is just the geometry of the drawing elements, no reference to the map yet, will be improved.

What can not be done yet:
- Loading of different maps
- Loading of bitmaps to draw
- Modifications of drawing elements (coordinates).
- Scaling with 3 points
- Undo and redo doesn't work yet

A very very small help file is included.

Your comments for the progress of the program will be welcome.

As once promised, the color selection module is included.

Best regards, and merry Christmas to you and to All who read this post.

EDIT 2008.12.31 : Removed files, new version in post #10.
 
Last edited:

ceaser

Active Member
Licensed User
Hi Klaus

Thank you very much.:sign0188:

I will work through it and give you my feedback.

Regards
Michael
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

Here is version 1.0 of the ScaledMap program.

I would be pleased to have some feedback of what is missing, improvement suggestions and bug reports.

What can be done:
- Different maps can be loaded.
- The map can be scaled, and the scaling saved (two points only yet).
- Drawings can be made onto the maps: polylines, circles, texts and bitmaps.
- For the circles, the radius can be defined (in pixels)
- For the texts, those can be input and font size selected.
- The colors are selectable.
- For the bitmaps, four images are predifined in the program at the moment, these can be deleted and others loaded.
- Select any element of the drawing and modify it. To change the position of an element, click on it, move it and release, or change the values.
- Save and load drawings. The saved data is just the geometry of the drawing elements, with a reference to the map. To load drawings, the program shows only those belonging to the map.

What can not be done yet:
- Scaling with 3 points
- Undo and redo not yet implemented
- Calculate the length of a polyline

What is still missing:
- no config file
- no VGA support
- no multi language
- no GPS support

A very very small help file is included, because of size restrictions, will be more complete in the next version.

The next version will be posted in the Share Your Creations forum.

Best regards, and a Happy New Year.

EDIT: 2009.01.09 Removed old version
The new version is now here: http://www.b4x.com/forum/share-your-creations/3674-scaled-maps.html#post21014
 
Last edited:

ceaser

Active Member
Licensed User
Hi Klaus

Thanks for the update, I was busy with some surveying work and a short holiday, but I will have a look at the mapping module starting today!

Just a question on the circle radius entery. Is it not more logical to enter the radius in meters rather than in pixels?

Anyway thanks for your help and I hope 2009 will be a good year for you.:sign0188:

Regards
Michael
 

klaus

Expert
Licensed User
Longtime User
Hi Michael,

For the circle radius it would depend on what you want or need:
- a circle with a fixed radius, independent of the scale (and zoom factor)
- a circle with a given dimension depending on the scale, then in what dimension meter, foot or in the map's scale unit?

There would be no problem to enter the radius in physical units.

For the bitmaps, would you like them scaled or with a fixed size. At the moment they are fixed size.

Another question, what units do have your maps in general ?

In the last version, not yet posted, I have added units for the map scaling, allowing polyline length calculations in various units. The possible units are long lat degrees, km, statued and nautic miles.

Do you agree that the next version will be posted in a new thread in 'Share your Creations' ?

I hope too that 2009 will bring you all the Best.

Best regards.
 
Last edited:

ceaser

Active Member
Licensed User
Hi Klaus

Leave the bitmaps the size that they are......fixed size. As far as the circles are concerned, these should be of a variable size and for the units, I think this should be in meters(for surveying requirements). I think it is only the Americans that are still working in feet. I wonder how they got their rockets on to moon\mars:confused::confused:

I suppose it is a good idea to post this program to the "Share Your Creations" thread, this way we can have a couple of suggestions and input from other users. Once I have figured out what you have done, I will attempt to link a GPS to the program.

Thanks Klaus.:sign0188: I wonder where Agraham is? Maybe still on holiday!!

Regards
Michael
 

ceaser

Active Member
Licensed User
Hi Agraham

That's a good one!!

Anyway, a good 2009 to you and your family.

Regards
Michael
 

ceaser

Active Member
Licensed User
Hi Agraham

I have just looked at the "Metric Mixup" report, I really don't know why these guys (the Americans) don't move over to the metric system?

If I could only have 1% of the money that they wasted, I could sit all day and program and not worry about getting food on the table!

Anyway:)

Regards
Michael
 
Top