Jump to content

Custom topo land cover toolchain?


oisact
Followers 4

Recommended Posts

First, it seems there is enough interest in map making, and it is a unique enough topic, to warrant its own sub forum here. That would help us find information without having to weed through the "GPS Units and Software" forum which has such a massive number of posts.

 

I've had good results making my own topo maps, with elevation contours and hydrology. If I could include land cover it would just about be perfect.

 

Is there any free / open source toolchain to get from the GeoTIFF raster file the USGS land cover exports, to something vector that GPSMapEdit can handle?

 

I found a program, Vextractor, that is $99 but has a usable demo version. It will vectorize GeoTIFF and save to MIF (MapInfo Interchange), which GPSMapEdit can import. However, only the registered version of GPSMapEdit can import MIF.

 

I will only make one or two maps of my local area, so I can't justify buying several pieces of software. If that's the case I'll just continue to do without the land cover.

 

Dan

Link to comment

I found a program, Vextractor, that is $99 but has a usable demo version. It will vectorize GeoTIFF and save to MIF (MapInfo Interchange), which GPSMapEdit can import. However, only the registered version of GPSMapEdit can import MIF.

 

MapScan can convert MIF to shapefiles, as can OziExplorer.

 

I'd love to see screenshots of the result and a review of Vextractor.

Link to comment

oisact

 

This isn't a land cover map, but it's something I've been playing around with. It's the first attempt at a shaded topo map. This screenshot is in GPSMapEdit, but it is vectored data not raster. I'll post a link to the IMG file when I get it finished. I just selected the colors from existing Garmin types. As I move toward a final version I'll probably be using custom types so the colors will be better...Hopefully!

 

http://www.vttrader.com/gpsmaps/ShadedTopo1.png

 

Let me know what you (or anyone else) thinks

 

VT

 

P.S. I think a cartography sub forum would be a good idea also.

Link to comment

Very nice. That sort of reminds me of this shaded-relief.

 

I've done some testing, and it is possible to achieve some very good results with the land cover. I compared a USGS 100k topo map to the vectorized land cover, and the quality is very close.

 

I'm currently stuck trying to bind colors in the vectorized MIF file to area types. I can load the MIF file in GlobalMapper, but the colors are all off, and no areas are defined a type. One possibility is for me to manually edit the MIF file so it only contains one type of area at a time, load that in GlobalMapper, and then assign it a type. Of course that would be very tedious.

 

I had GlobalMapper export a MIF / MID pair, to see how it encodes areas. That is defined in the MID file. However when I reopen the MIF back in GlobalMapper it doesn't display anything. That's not very encouraging that GlobalMapper cannot properly read back a file it has just written.

 

Redwoods, thanks for the links. I tried both those applications and didn't have any success with them reading the MIF file. Neither would display anything.

 

Dan

 

Edit: changed 24k to 100k

Edited by oisact
Link to comment

I'm not exactly sure what you mean by "manually edit the MIF", have you tried editing in GlobalMapper (GM)with the search feature? You can search for a particular type, then select all, and edit them as a batch.

 

What I have done in GM is use the search feature to find a particular type then, then select all and add a new attribute, give it a name and then assign it an existing Garmin type code (or what will be a type code if I use custom types). Then I export from GM the data as a shapefile. Then in GPSMapEdit you can import the shapefile and in the import dialog you can select the "from field" tab and have it use the attribute field you added in GM as it's Garmin type.

 

BTW, not sure if you saw this link to some other maps/screenshots of maps that I've made.

http://www.vttrader.com/gpsmaps/

 

VT

Link to comment

I hoped GPSMapEdit might work. However, the MIF file Vextractor produces uses "Nonearth" coordinates, which GPSMapEdit won't import. Global Mapper loads the file fine (except for the colors / area types).

 

I think it's time for some screenshots.

 

Original exported land cover GeoTIFF:

lc1.jpg

 

Vectorized by Vextractor (better quality is possible, but will result in more polys):

lc2.jpg

 

1:100k USGS map for comparison:

lc3.jpg

 

After loading into GlobalMapper:

lc4.jpg

 

My plan is to remove most all area types, like water, roads, populated areas, etc, leaving mainly vegetation.

 

Dan

Link to comment

I'm not exactly sure what you mean by "manually edit the MIF", have you tried editing in GlobalMapper (GM)with the search feature? You can search for a particular type, then select all, and edit them as a batch.

 

Editing the MIF file in a text editor like Notepad.

 

I tried the search function, and if that would work then I would have it made. It seems there aren't any unique attributes it can use. For every single item it says "<UNNAMED FEATURE>", "Unknown Area Type", and 0 for color.

 

Dan

Link to comment

Yeah, not having any differentiating type features makes that method impossible.

 

You could try selecting the colors with the digitizer tool and holding ctrl as you click on them, then right-click and choose edit selected features, then add an attribute to identify them by color. That could get pretty tedius also, but might be easier than using a text editor.

 

VT

Link to comment

OK here is perhaps a better way. You can select the way I suggested in the last post with the digitizer tool, and assign it an existing (or custom if you have some setup) GM type. In the configuration dialog, on the "vector display" tab, setup some "area filters" so that once you edit the type it disappears from the display, and then you can go on to the next color and repeat. This would make it easier see the areas that have not been edited.

 

When done make sure to undo your filters to bring back the edited features.

 

VT

 

Edit: The type featue can be anything, it's just used to differentiate the features in GM. I would still suggest adding an attribute at the same time so you can assign a Garmin type, and then exporting as shapefile, to import into GPSMapEdit. That's the easiest way I've found to get something into GPSMapEdit.

 

Edit2: If you select by the largest color areas and are left with a bunch of real small areas that are all the same color, you can just use the digitizer tool to draw a box around everything to select them all at once.

Edited by VTtrader
Link to comment

Oisact,

I just tried your steps with a land cover file and vectorizing with Vextractor and exporting as MIF. In GM when I used the "search by attribute, name, and description" function, I got as you said no distinguishible name or type attributes, but I got a unique color attribute which can be used to filter the areas by color. Then you can select all and edit them how I mentioned previously.

I also noticed, while GM opened the file just fine, the coordinates are off. It seems at some point along the way the exported MIF file needs to be geo-referenced, either before export in Vextractor, or in GM. The referencing of the geotiff doesn't seem to make it through the vectoring process. At least not that I've seen.

 

VT

 

BTW there is a work around for those watermarks.

Edited by VTtrader
Link to comment

I checked again, and all the color values are 0 for me. So I vectorized the TIFF again and now I see the color values. So somewhere in my manual editing of the MIF I messed those up.

 

My one concern at this point is when I remove some of the polygons, sometimes there are other polygons behind them. For example, I may remove some road, and underneath it is woods. That is just a side affect of the vectorization process - it probably makes the filesize smaller to overlap polys in certain cases. Hopefully there are some settings in Vextractor to take care of that.

 

I have a couple techniques for removing the watermarking, so I'm good there.

I haven't reached the maximum filesize yet that the demo version supports. Hopefully it's pretty big. :D

 

Thanks!

 

Dan

Link to comment

How far are the coordinates off for you? I overlaid my land cover onto the 1:100k USGS topo map in Global Mapper, and it is extremely close. If anything, the custom map might be slightly too high - like by 1 pixel worth in the original TIFF file.

 

Dan

 

Hmmm, mine are WAY off like not even visible on the screen, I have to close all other layers in GM and do "view full map" just to find a little dot at 1:20425300 scale, then zoom in from there. I obviously did something wrong, it was using something like the "nonearth" coordinates that you mentioned......

 

Oooops! on second thought scratch that. I took another look at it in GM and it was the other layer that I had loaded that had the wrong coordinates. Vextractor layer seems right.

 

VT

Link to comment

Okay, I've got at least a county's worth of land cover on my GPS now, and I'm pretty pleased with the results. Currently the GPSr is rendering the wooded areas like trees - sort of like random sized irregular circles. I don't know if I like that - it looses a bit of detail, and its hard to tell exactly where the edges of the wooded areas are. Also, regardless of the zoom level, the trees are always rendered at the same scale, which I don't really like. So I'll probably see about rendering those polys solid, or maybe with a custom texture (if you can render predefined area types in a custom way - I might have to change them to a custom area type).

 

The demo version of Vextractor has a limit of 30,000 elements when saving (if I remember the number correctly). By extremely good luck, when I vectorized and saved an entire county, Vextractor first saved the wooded polys, then was in the process of saving the hydro polys when it hit the limit. So it actually saved me work by not exporting the other area types I didn't want.

 

I've figured out a pretty fast method of removing the polys I don't want in Global Mapper. There are two colors I wanted to keep - green and dark green. The color values for those are 6728299 and 3368476. So first I found each of those colors, then modified those polys to have the Wooded Area type. Then I did a search for elements NOT having the "Wooded Area" type (!=), and deleted those. So it was basically three manual steps to cull it down (which removed the water marks too).

 

The resulting IMG file was only 749k.

 

Dan

Link to comment

Here are some screenshots. While taking these I noticed another problem. The land cover is being drawn at too high of a layer - it is covering my hydrology map, and its covering some roads too, like interstates that have thickness to them. Also, as I mentioned above, the land is slightly north of where it should be. These are displaying my custom hydrology, elevation contours and now land cover maps, as well as MetroGuide North America 7.

 

Trees should follow south edge of river, not overlap it:

ss1.jpg

 

Day color screen of same area:

ss3.jpg

 

Same area without land cover map. Note how much more detailed the river is - it has thickness.

ss4.jpg

 

1:24k USGS topo of same area:

ss2.jpg

 

So, any suggestions on changing the draw order between my custom maps?

 

Dan

Edited by oisact
Link to comment

Nice work Dan!

 

I'm not sure if you can work with the draw order between maps. I know you can change the draw order in a single map with a typ file (I haven't done it, but have read the process). I'm not sure if the GPSr renders areas from all maps with a specific draworder, or whether it renders each map seperately. A work around might be to include your hydrology map "areas" in your land cover map, so that you can control the draworder of all area types in a .typ file.

 

As for the zoom issue, Have you played around with the levels in GPSMapEdit, maybe changing the bits for the levels would help. Alternatively, you might want to merge (or alter in some way) some of the areas at level1 or level2.

 

Again, nice work,

 

VT

Link to comment

I tried setting the draw order for the woods polys (0x50) to the lowest level, but as you predicted, that does not affect the draw order between maps. There must be some way of determining which map gets drawn first - I doubt that is completely random.

 

Your suggestion of merging in the other maps would work - but only for the maps I have control over. The issue with the woods covering interstates and other non-line roads would still exist. Also, I like having the elevation contours, hydrology and land cover as separate maps, so I can select which I want to view on the GPSr itself.

 

One workaround for now is that I changed the bitmap for woods polys to be something mostly transparent. That works pretty well, as these screenshots show:

 

ss5.gif

 

ss6.gif

 

Another potential solution is to make the land cover map opaque - but that would only work if I could be certain it is rendered first in place of the default yellow background. However, if I could make it render first, then that would solve the problem anyway.

 

Dan

Link to comment

Nice work Dan!

 

I'm not sure if you can work with the draw order between maps. I know you can change the draw order in a single map with a typ file (I haven't done it, but have read the process). I'm not sure if the GPSr renders areas from all maps with a specific draworder, or whether it renders each map seperately.

...

Assuming you're using cGPSMapper to create your img files, you might take a look at the Test_img.mp file. It has a handful of settings that aren't documented in the manual. I was just looking at it and came across a setting called "DrawPriority" that goes in the ID header. Here's a snippet from the example file:

;DrawPriority = (optional, default = 25)
;		set the draw order for the map - the higher value, the later map is redrawn in the GPS - map with DrawPriority=27
;		will be visible over the map with DrawPriority=25

Might be worth a shot to lower the value to get your landcover map drawn first, then allow the other maps to draw over top.

Link to comment

SiliconFiend, you beat me to it, I just found out about the DrawPriority settting, and was going to post when I saw your post. It is in the manual for cgpsmapper, just not explained very well. This is from the cgpsmapper manual:

 

DrawPriority=# Value between 0 and 31 indicating the priority used by the

GPS to draw the map. The highest value – the highest

priority is set.

Priority for the transparent maps is calculated by adding

always 32 to the set priority by DrawPriority value.

Default = 25.

 

VT

Link to comment

Thanks. I originally downloaded cGPSMapper from the official site, but the zip only included the EXE and nothing else.

 

Do you know what the draw priority is for the Garmin maps? Specifically the MetroGuide map. Also, is the MetroGuide map transparent? Or does it cover the base map? If it isn't transparent then it won't be possible for me to fix the issue with land cover overlapping some roads.

 

Dan

Link to comment

Okay, in GPS Map Edit I opened the .MP, went to Map Properties, then Extras tab, and added a property for DrawPriority. First I tried level 20, since 25 is the default. That did indeed fix the problem as far as my custom maps were concerned. The land cover now draws under all my custom maps, so it no longer occludes rivers. However, the land cover still draws over roads. So I tried level 1 and level 0, and the problem persisted.

 

The MetroGuide maps must not be transparent. I created a non-transparent map with DrawPriority 1 and it was not visible.

 

As far as I can tell, my only recourse is to modify the MetroGuide maps so they are not transparent. However that would probably allow the base map to show through, resulting in some duplicate roads. A solution would be to create an entire map for the USA that is not transparent but blank, that can be used behind the MetroGuide maps.

 

Any thoughts on this? I wonder how this guy did it? VTrader, with your shaded elevation maps, have you addressed this problem yet?

 

Dan

Link to comment

From what I have read in some literature from Garmin none of their maps are transparent.

 

I've been doing some experimenting with .mpt/.TYP files for custom types. My understanding is that the draworder is shared among all maps in memory. If that is the case, you should be able to make sure your custom area types are rendered first regardless of what map they come from. As long as you include a .TYP file

 

For example, I have Garmin CN v8 and a transparent custom map derived from TIGER data. They both have the same (few sq. mile) area near here that is a military firing range. On the custom map it has a type code of 0x0013 Building/man-made area, on CN I can't be sure what the type code is. Not using a custom draworder, when the maps are drawn, the custom map's area appears on top. I would kind of expect that something with a building/man-made area would be drawn last. However, as best I can tell, when I look at the interstate both CN and the custom map seem to draw the road at the same time. So it seems that they might indeed share a common draworder.

 

I still have some more experimenting to do, and I'll let you know what I find out.

 

VT

 

Edit:

I looked at the custom draworder, if CN assigned an area code of 0x0004 Military Base the draworder puts it at 5, where as, 0x0013 has an order of 6. So it would be drawn on top.

Edited by VTtrader
Link to comment

I tried setting the draw order (see this post), but that didn't have any affect.

 

Here's a screenshot with the proper rendering within my own custom maps. I changed the polygon bitmap to something solid (I just set the transparent color to green, and made the existing green a bit brighter).

 

ss7.gif

 

If I could just get it rendering properly relative to roads I'll have it made. Oh, some higher res land cover data would be nice too. I determine that its not that the land cover is out of alignment, but it simply isn't that precise. The raster GeoTIFF is pretty low resolution, so an individual pixel covers a pretty large area.

 

Dan

Link to comment

I checked again, and all the color values are 0 for me. So I vectorized the TIFF again and now I see the color values. So somewhere in my manual editing of the MIF I messed those up.

 

My one concern at this point is when I remove some of the polygons, sometimes there are other polygons behind them. For example, I may remove some road, and underneath it is woods. That is just a side affect of the vectorization process - it probably makes the filesize smaller to overlap polys in certain cases. Hopefully there are some settings in Vextractor to take care of that.

 

I have a couple techniques for removing the watermarking, so I'm good there.

I haven't reached the maximum filesize yet that the demo version supports. Hopefully it's pretty big. :unsure:

 

Thanks!

 

Dan

 

Hi there,

I was wondering If I can get your techniques on removing the watermarking ?

Or maybe point me in in the right direction, thanks in advance for your help . :ph34r:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Followers 4
×
×
  • Create New...