Re: ps2raster offset with world file
Joaquim Luis <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
Brent, I did this sort of testings when implementing this ps2raster option and the results were very satisfactory. I rechecked with one our examples in the ps2raster man page with a further refinement regarding the line thickness (attention, GMT5 syntax here) gmt pscoast -JX12cd -R-10/-4/37/43 -W0.1p -Di -Bg30m -P -G200 --MAP_FRAME_TYPE=inside --MAP_FRAME_PEN=0.1p > cara.ps gmt ps2raster cara.ps -Tt -W and the result confirmed in Mirone is perfect (and is equaly perfect on the North top). Maybe a QGIS problem? Can you check with Mirone? > Thanks Joaquim, > > All the text & scale content drawn in the map lie within the map > extent in the figure defined by the -R parameter, so there should not > be ANY content outside the map area. > > If I comment out the pstext & psscale commands, the map is unchanged. > I also need to try another mapping tool to check that the issue is > with the maps rather than the QGIS overlay of the layers. > > > The error, from the .gmtdefaults4 file: > > initial state: > BASEMAP_TYPE = plain > FRAME_PEN = 1.25p > > after running "gmtset BASEMAP_TYPE inside" > > BASEMAP_TYPE = FRAME_PEN = 1.25p > > I have not tried manually editing the .gmtdefaults4 file to set > BASEMAP_TYPE to inside > > > Cheers, > > Brent > > > ------------------------------------------------------------------------ > *From:* Joaquim Luis <[email protected]> > *To:* [email protected] > *Sent:* Sunday, February 2, 2014 11:27 AM > *Subject:* Re: [GMT-HELP] ps2raster offset with world file > > Brent, > > It must be pscale. For the same reason we must use BASEMAP_TYPE=inside > we cannot have other drawings outside the map frame. This will trick > the coordinates-from-pixels algorithm that assumes all pixels of the > rasterization belong to the map. > > and yes, you need to repeat the inline setting for all the commands. > The idea of the inline is that it works only on the command where it > is invoked. > > What was the error when you tried to default basemap type to "INSIDE"? > > Joaquim > >> Hi, >> >> I have a problem with a png + worldfile image by ps2raster >> georeferencing correctly. I figured I'd ask here before submitting a >> bug report in case I'm the bug... >> >> The map is generated by a script - as below. A small part of the >> output image is attached. The red coastline shows the actual vector >> coastline opened in QGIS, overlayed on the GMT image which includes >> the same (rendered/pixellated)coastline. >> >> As shown in the image, the ps2raster coastline appears to be offset >> from the vector coastline. About a 1km offset in real world >> distances. This offset is worse towards the top of the map. >> >> I note that I can't set the default basemap type to "INSIDE" - this >> results in an error - and using the inline approach as for the >> psbasemap command below does not reset the gmtdefaults4 file - this >> remains set to "plain". Do I need to include the inline setting for >> all the commands? >> >> Any advice appreciated... >> >> Brent Wood >> >> >> # generate lat/lon png with world file >> psbasemap -R$REG -JX5i -P -K -B/::wesn --BASEMAP_TYPE=inside > $PS2 >> psxy nz_shelf.gmt -R$REG -JX -W1 -m -K -O -G210/240/245 >> $PS2 >> psxy nz_50m.gmt -R -JX -W1 -m -O -K -G230/255/255 -W1/230/255/255 >> >> $PS2 >> # psxy nz_coast.gmt -R -JX -W1 -m -O -K -G200 >> $PS2 >> >> # overlay with specific data >> echo "175 -52.5 10 0 1 ML Species/year" | pstext -R -JX -W -O -K >> >> $PS2 >> echo "175 -53.2 10 0 1 ML All spp $YR" | pstext -R -JX -W -O -K >> >> $PS2 >> >> echo "adding scale" >> psscale -D10/3.2/3.0/0.3 -C$CPT -A -L -O -K -B::/:: >> $PS2 >> echo "175.5 -45.1 10 0 1 ML Tows/cell" | pstext -R -JX -W -O -K >> >> $PS2 >> >> #plot cells >> echo "plotting cells" >> # with clip path >> psclip nz_shelf.gmt -R -J -m -O -K >> $PS2 >> cat $FILE | psxy -R -JX -O -K -Ss$SYM_SIZE -C$CPT >> $PS2 >> psclip -C -O -K >> $PS2 >> >> # draw coast >> psxy nz_coast.gmt -R -JX -W1 -m -O -G200 >> $PS2 >> >> # generate png with world file >> ps2raster -Tg -Au -E600 -W $PS2 >> To unsubscribe, send the message "signoff gmt-help" to >> [email protected] <mailto:[email protected]> > > To unsubscribe, send the message "signoff gmt-help" to > [email protected] > > > To unsubscribe, send the message "signoff gmt-help" to > [email protected] To unsubscribe, send the message "signoff gmt-help" to [email protected]