MapWindow 4 - Desktop Application : MapWindow Discussion Forum
hi to all I noticed that clipping grid with polygon produces two unexspected results: 1) the raster-grid file looses its colours (but it is not so important) 2) the grid clipped is slighty misplaced than before being clipped, so it is necessary to georeference it again.
clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: December 11, 2011 01:16PM

hi to all
I noticed that clipping grid with polygon produces two unexspected results:
1) the raster-grid file looses its colours (but it is not so important)
2) the grid clipped is slighty misplaced than before being clipped, so it is necessary to georeference it again.
I looked for this into the discussion forum, but did'n find something like it.

sandro

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: pmeems ()
Date: December 16, 2011 08:48AM

I'm having the same issue.
I don't know why this is happening.
The 'clip grid with polygon' is part of the mwGeoProc library.
It hasn't been updated in a long time.
Perhaps moving this to the ocx will solve this issue.

You can request for it for v4.9: [mapwindow4.codeplex.com]

Looking at that page I see a post by Mathew saying he's using a different algorithm:
[dotspatial.codeplex.com]

Perhaps you can use that.
Let us know if it is working.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: December 16, 2011 11:07AM

Paul
if I understood correctly, I have to insert the file attached into the MWG folder.
But I don't know where I have to put it. Or I have completely misunderstood?
Sandro

sandro

Attachments: ClipRasterWithPolygon.cs (4.7 KB)  
Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: pmeems ()
Date: December 16, 2011 12:44PM

Sorry Sandro,

You completely misunderstood.

At this time it is not possible to use DotSpatial code directly in MapWindow.
You need to use the code as an example for creating a new plug-in/tool for MapWindow.
That is quit a lot of work because DotSpatial uses a different class scheme than MapWindow does.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: January 19, 2012 10:38AM

Paul
if it can be useful to know, trying and retrying, I noticed that this issue happens only when i try to clip grids georeferenced using "Image to Map"; when I try to clip them using QGis I receive the following message: "Cannot compute bounding box of cutline".
Instead, when I clip grids geofeferenced with ArcMap, che clip done with MWG is quite perfect.
Perhaps the problem is into Image to Map, that, otherways, is now working well; unless I have used it in a wrong way.
Sandro

sandro

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: gngdowid ()
Date: January 19, 2012 02:01PM

Hi Samndro,
good to hear that the Image to Map plug-in works well. That means the World file now is truely compatible with how MW handles images referenced in a coordinate system.
I suspect that the clip routine may create a clipped image with a World file having erranious values.
Could you try, just for the fun of it, to apply the second option, "Image Rectification", in the Image to Map plug-in and then try to clip the resulting rectified image. The new image file has the same name with the worl "Recti" inserted.
Good luck, Gerd

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: January 20, 2012 03:19AM

hi Gerd
fantastic! now the "clippin grid with polygon" works very well.
I did what you wrote, following the following sequence (hoping it is useful to other guys)(I work with EPSG 3004)
1) georeference imagine using IMAGE TO MAP (image registration)
2) rectify image using IMAGE TO MAP (image rectification)
The image with which I began was .tif, but the image after rectification was .jpg; so
3)using GVSIG I converted into tif
4) uploaded on MWG as .grid file
5)clipped with polygon.
I hove no knowlege to understand why now it is ok, but i will study it.
thank you a lot
Sandro

sandro

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: gngdowid ()
Date: January 20, 2012 02:42PM

Sandro and especially Sergei and Paul,
what you are experiencing is the effect of changes to the way MW accepts and uses World File parameters for images and grids in its display. These changes seem to date back to the change over from MW 4.8.4 to 4.8.6.
These changes concern any plug-in written before MW 4.8.6 was issued.
Assume the world file parameters for example for MW 4.8.6 are
a = 0.00002954
b = 0.00000167
c = 0.00000298
d = -0.0000292
e = -34.89204682
f = -8.05641917

In the older version before 4.8.6 the parameter sequence used was
a = 0.00002954
b = 0.00000298 <-- swapped c to b
c = 0.00000167 <-- swapped b to c
d = -0.0000292
e = -34.89204682
f = -8.05641917
As far as I can make out the following plug-ins have been effected by this

1. Image To Map (has been fixed to comply with the 4.8.6 sequence)
2. Georeference Grid or Image (not fixed) and
3. Clip Grid (not fixed)

The reason why I suggested to you to use the Image Rectification plug-in option is that the resulting image has a World File with parameters b and c = 0.0
So the swap of these parameters will have no effect at all.
The world File for the rectified image for the examples given above looks like this:
a = 2.9536E-05
b = 0
c = 0
d = -0.00002954
e = -34.89204682
f = -8.05339638


There may be more image handling plug-ins effected which I don't know at this stage.

The good news is that the sequence of parameters in the World File as used in MW 4.8.6 now is compatible with ESRI's ArcMap. I have not tested against other GIS programs, but I assume they also use the ESRI style sequence.

By the way, you could have fixed you clipping problem most likely by also swapping the two parameters concerned (just as an interim work around).

Cheers, Gerd



Edited 1 time(s). Last edit at 01/20/2012 02:45PM by gngdowid.

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: January 20, 2012 09:55PM

I tryed to clip the rectified file with GVSIG and it works well; with QGIS it doesn't work and displays the message "Cannot compute bounding box of cutline".

sandro

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: kulenbek ()
Date: May 20, 2012 08:24AM

Hi people,

I have a problem with clipping srtm grid.tif file using a tool "Clip grid with poligon" in MW. I was following the manual step by step i.e. I did everything as written in the manual, but at the end of clipping process, after clicking "OK" the expression like "0 shapes selected" is written below the "Clip Grid" tool window. Why the "Clip Grid" tool cannot see the shape file? Does it mean that "Clip Grid" tool of MW not working properly or there is other resons? Please I need your help to solve this problem.

Cheers, Kulenbek

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: sandro ()
Date: May 20, 2012 10:21AM

hi
I used this tool recently.
As to the "O shapes selected", after selecting again the feature(s) it works correcly.
as to the misplacing of the grid, I had the same problem when I used grids georeferenced using "Image to map tool" because of an error of the tool; the problem has been solved by the creator of the tool,Gngdowid, and now it works perfectly. I think you schould download the new .dll file he created.

sandro

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: gngdowid ()
Date: May 20, 2012 04:21PM

Sandro, who who replied to your call for help assumed that you had to georeference your tif image before strating to clip it with a polygon.
I am NOT the creator of the clipping tool, but I created the Image to Map Referencing tool.
The referencing tool which originally was included in the 4.8.6 final installer was not the final version. It had still a severe bug.
You can download the correct working Referencing tool from [ge-bi-do.net] and copy it to
C:\Program Files\MapWindow\Plugins\Gerd_tools. This will give you the georeferenced image in the correct map position.
I hope that this will also solve your clipping problem. If not, you could contact Paul Meems at bontepaarden@gmail.com.
He can possibly help you or at least give you the contact information for this plug-ins creator.
By the way, most of these bugs have been corrected in the latest MW version 4.8.7. I recommend to install this new version.

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: kulenbek ()
Date: June 23, 2012 01:38PM

Hi Gerd,

Thanks but I did not find that place where I could download the correct working Referencing tool from [ge-bi-do.net]. Could you please guide me in the ge-bi-do.net?

Also where could I download the latest MW version 4.8.7.?

Kind regards,

Kulenbek

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: gngdowid ()
Date: June 23, 2012 07:48PM

Try the following URL:

[ge-bi-do.net]

Then copy the file ImgRegPluginCSharp.dll to C:\Program Files\MapWindow\Plugins\Gerd_tools
on your hard drive.

The latest official version of MapWindow 4.8 has not been updated. However,
there is an updated version somewhere on the MapWindow web site. I'll have a look and report back as soon as I have found it again.
Cheers, Gerd

Options: ReplyQuote
Re: clippin grid with polygon misplaces the grid clipped
Posted by: gngdowid ()
Date: June 23, 2012 07:57PM

Download location for MapWindow v4.8.7:

[tinyurl.com]

This is the link to the latest monthly builds of MW.

If you try this, you should not need to download and copy the ImgRegCSharp.dll

Cheers, Gerd

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: