Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-01 Thread Steve Lime
What does the mapfile look like?

On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe  wrote:

> Hi
>
> I have a GeoTiff file that gdalinfo presents like this:
>
> gdalinfo sat.tif
> Driver: GTiff/GeoTIFF
> Files: sat.tif
> Size is 10474, 10717
> Coordinate System is `'
> GCP Projection =
> GEOGCS["WGS 84",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich",0],
> UNIT["degree",0.0174532925199433],
> AUTHORITY["EPSG","4326"]]
> GCP[  0]: Id=1, Info=
>   (0,0) -> (27.5783052509812,65.9184735836942,229.992792810313)
> GCP[  1]: Id=2, Info=
>   (524,0) -> (27.1416007200269,65.9731480840222,172.994255514815)
> GCP[  2]: Id=3, Info=
>   (1048,0) -> (26.7005564512604,66.0268770755367,152.994545626454)
> GCP[  3]: Id=4, Info=
>   (1572,0) -> (26.257537545879,66.0793551447287,131.994995356537)
> GCP[  4]: Id=5, Info=
>   (2096,0) -> (25.8102107755995,66.1308402121171,163.993212723173)
> 
>
> with 482 GCPs.
>
>
> The file opens ok in Qgis and is located in the right location.
> But I can´t in any way get it to show correctly in Mapserver.
>
> Is this possible to do? Or do I have to gdalwarp the file to a known
> projection and set the PROJECTION of the layer?
>
> Thanks
> Jesper
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-02 Thread Jesper Kempe
Hi

This is the mapfile:

MAP
NAME "map"
WEB
METADATA
"wms_title""WMS mapserver"
"wms_srs"  "EPSG:4326 EPSG:3021 EPSG: EPSG:3006
EPSG:900913"
"wms_extent"   "1225000 613 191 7675000"
"wms_enable_request"   "*"
"wfs_enable_request"   "*"
END
END

PROJECTION
"init=epsg:4326"
END

EXTENT -180 -90 180 90

LAYER
  NAME "sat"
  DATA "sat.tif"
  TYPE RASTER
  STATUS ON

  METADATA
"wms_title" "sat"
  END

  PROJECTION
"init=epsg:4326"
  END
  EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146
66.7744046276809797

END

END

I have also tried both without PROJECTION in LAYER and with
PROJECTION
 AUTO
END

None of them works.

EXTENT in the mapfile is taken from Qgis metadata of the layer.


Thanks
Jesper

Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime :

> What does the mapfile look like?
>
> On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe 
> wrote:
>
>> Hi
>>
>> I have a GeoTiff file that gdalinfo presents like this:
>>
>> gdalinfo sat.tif
>> Driver: GTiff/GeoTIFF
>> Files: sat.tif
>> Size is 10474, 10717
>> Coordinate System is `'
>> GCP Projection =
>> GEOGCS["WGS 84",
>> DATUM["WGS_1984",
>> SPHEROID["WGS 84",6378137,298.257223563,
>> AUTHORITY["EPSG","7030"]],
>> AUTHORITY["EPSG","6326"]],
>> PRIMEM["Greenwich",0],
>> UNIT["degree",0.0174532925199433],
>> AUTHORITY["EPSG","4326"]]
>> GCP[  0]: Id=1, Info=
>>   (0,0) -> (27.5783052509812,65.9184735836942,229.992792810313)
>> GCP[  1]: Id=2, Info=
>>   (524,0) -> (27.1416007200269,65.9731480840222,172.994255514815)
>> GCP[  2]: Id=3, Info=
>>   (1048,0) -> (26.7005564512604,66.0268770755367,152.994545626454)
>> GCP[  3]: Id=4, Info=
>>   (1572,0) -> (26.257537545879,66.0793551447287,131.994995356537)
>> GCP[  4]: Id=5, Info=
>>   (2096,0) -> (25.8102107755995,66.1308402121171,163.993212723173)
>> 
>>
>> with 482 GCPs.
>>
>>
>> The file opens ok in Qgis and is located in the right location.
>> But I can´t in any way get it to show correctly in Mapserver.
>>
>> Is this possible to do? Or do I have to gdalwarp the file to a known
>> projection and set the PROJECTION of the layer?
>>
>> Thanks
>> Jesper
>>
>>
>> ___
>> mapserver-users mailing list
>> mapserver-users@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-02 Thread Rahkonen Jukka (MML)
Hi,

I am not suggesting this as a final solution yet, but gather some knowledge and 
try if image works when a) warped into GeoTIFF with gdalwarp b) warped into .vrt

-Jukka Rahkonen-

Lähettäjä: mapserver-users  Puolesta 
Jesper Kempe
Lähetetty: keskiviikko 2. syyskuuta 2020 10.52
Vastaanottaja: Steve Lime 
Kopio: Mapserver 
Aihe: Re: [mapserver-users] Use Ground Control Points from GeoTIFF

Hi

This is the mapfile:

MAP
NAME "map"
WEB
METADATA
"wms_title""WMS mapserver"
"wms_srs"  "EPSG:4326 EPSG:3021 EPSG: EPSG:3006 
EPSG:900913"
"wms_extent"   "1225000 613 191 7675000"
"wms_enable_request"   "*"
"wfs_enable_request"   "*"
END
END

PROJECTION
"init=epsg:4326"
END

EXTENT -180 -90 180 90

LAYER
  NAME "sat"
  DATA "sat.tif"
  TYPE RASTER
  STATUS ON

  METADATA
"wms_title" "sat"
  END

  PROJECTION
"init=epsg:4326"
  END
  EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146 
66.7744046276809797

END

END

I have also tried both without PROJECTION in LAYER and with
PROJECTION
 AUTO
END

None of them works.

EXTENT in the mapfile is taken from Qgis metadata of the layer.


Thanks
Jesper

Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime 
mailto:sdl...@gmail.com>>:
What does the mapfile look like?

On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe 
mailto:jesper.ke...@gmail.com>> wrote:
Hi

I have a GeoTiff file that gdalinfo presents like this:

gdalinfo sat.tif
Driver: GTiff/GeoTIFF
Files: sat.tif
Size is 10474, 10717
Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
  (0,0) -> (27.5783052509812,65.9184735836942,229.992792810313)
GCP[  1]: Id=2, Info=
  (524,0) -> (27.1416007200269,65.9731480840222,172.994255514815)
GCP[  2]: Id=3, Info=
  (1048,0) -> (26.7005564512604,66.0268770755367,152.994545626454)
GCP[  3]: Id=4, Info=
  (1572,0) -> (26.257537545879,66.0793551447287,131.994995356537)
GCP[  4]: Id=5, Info=
  (2096,0) -> (25.8102107755995,66.1308402121171,163.993212723173)


with 482 GCPs.


The file opens ok in Qgis and is located in the right location.
But I can´t in any way get it to show correctly in Mapserver.

Is this possible to do? Or do I have to gdalwarp the file to a known projection 
and set the PROJECTION of the layer?

Thanks
Jesper


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-02 Thread Jesper Kempe
Yes, a gdalwarp on the file works fine but I would really like to avoid
that.
A "gdalwarp -t_srs "EPSG:3857" sat.tif sat_3857.tif" and use the file
sat_3857.tif works.

The file I want to show in Mapserver is available at
https://drive.google.com/file/d/1t3fM0Ej1FGwrdqbvg5EhIFcpnNOfKdQS/view?usp=sharing
if anyone wants to give it a try.

//Jesper

Den ons 2 sep. 2020 kl 10:26 skrev Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi>:

> Hi,
>
>
>
> I am not suggesting this as a final solution yet, but gather some
> knowledge and try if image works when a) warped into GeoTIFF with gdalwarp
> b) warped into .vrt
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* mapserver-users  
> *Puolesta
> *Jesper Kempe
> *Lähetetty:* keskiviikko 2. syyskuuta 2020 10.52
> *Vastaanottaja:* Steve Lime 
> *Kopio:* Mapserver 
> *Aihe:* Re: [mapserver-users] Use Ground Control Points from GeoTIFF
>
>
>
> Hi
>
>
>
> This is the mapfile:
>
>
>
> MAP
> NAME "map"
> WEB
> METADATA
> "wms_title""WMS mapserver"
> "wms_srs"  "EPSG:4326 EPSG:3021 EPSG:
> EPSG:3006 EPSG:900913"
> "wms_extent"   "1225000 613 191 7675000"
> "wms_enable_request"   "*"
> "wfs_enable_request"   "*"
> END
> END
>
> PROJECTION
> "init=epsg:4326"
> END
>
> EXTENT -180 -90 180 90
>
> LAYER
>   NAME "sat"
>   DATA "sat.tif"
>   TYPE RASTER
>   STATUS ON
>
>   METADATA
> "wms_title" "sat"
>   END
>
>   PROJECTION
> "init=epsg:4326"
>   END
>   EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146
> 66.7744046276809797
>
> END
>
> END
>
>
>
> I have also tried both without PROJECTION in LAYER and with
>
> PROJECTION
>
>  AUTO
>
> END
>
>
>
> None of them works.
>
>
>
> EXTENT in the mapfile is taken from Qgis metadata of the layer.
>
>
>
>
>
> Thanks
>
> Jesper
>
>
>
> Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime :
>
> What does the mapfile look like?
>
>
>
> On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe 
> wrote:
>
> Hi
>
>
>
> I have a GeoTiff file that gdalinfo presents like this:
>
>
>
> gdalinfo sat.tif
> Driver: GTiff/GeoTIFF
> Files: sat.tif
> Size is 10474, 10717
> Coordinate System is `'
> GCP Projection =
> GEOGCS["WGS 84",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich",0],
> UNIT["degree",0.0174532925199433],
> AUTHORITY["EPSG","4326"]]
> GCP[  0]: Id=1, Info=
>   (0,0) -> (27.5783052509812,65.9184735836942,229.992792810313)
> GCP[  1]: Id=2, Info=
>   (524,0) -> (27.1416007200269,65.9731480840222,172.994255514815)
> GCP[  2]: Id=3, Info=
>   (1048,0) -> (26.7005564512604,66.0268770755367,152.994545626454)
> GCP[  3]: Id=4, Info=
>   (1572,0) -> (26.257537545879,66.0793551447287,131.994995356537)
> GCP[  4]: Id=5, Info=
>   (2096,0) -> (25.8102107755995,66.1308402121171,163.993212723173)
>
> 
>
>
>
> with 482 GCPs.
>
>
>
>
>
> The file opens ok in Qgis and is located in the right location.
>
> But I can´t in any way get it to show correctly in Mapserver.
>
>
>
> Is this possible to do? Or do I have to gdalwarp the file to a known
> projection and set the PROJECTION of the layer?
>
>
>
> Thanks
>
> Jesper
>
>
>
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-02 Thread Rahkonen Jukka (MML)
Try to warp into .VRT, that takes so little time and disk space that it could 
be a workaround if it works.

-Jukka-

Lähettäjä: Jesper Kempe 
Lähetetty: keskiviikko 2. syyskuuta 2020 11.40
Vastaanottaja: Rahkonen Jukka (MML) 
Kopio: Steve Lime ; Mapserver 

Aihe: Re: [mapserver-users] Use Ground Control Points from GeoTIFF

Yes, a gdalwarp on the file works fine but I would really like to avoid that.
A "gdalwarp -t_srs "EPSG:3857" sat.tif sat_3857.tif" and use the file  
sat_3857.tif works.

The file I want to show in Mapserver is available at 
https://drive.google.com/file/d/1t3fM0Ej1FGwrdqbvg5EhIFcpnNOfKdQS/view?usp=sharing
 if anyone wants to give it a try.

//Jesper

Den ons 2 sep. 2020 kl 10:26 skrev Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>:
Hi,

I am not suggesting this as a final solution yet, but gather some knowledge and 
try if image works when a) warped into GeoTIFF with gdalwarp b) warped into .vrt

-Jukka Rahkonen-

Lähettäjä: mapserver-users 
mailto:mapserver-users-boun...@lists.osgeo.org>>
 Puolesta Jesper Kempe
Lähetetty: keskiviikko 2. syyskuuta 2020 10.52
Vastaanottaja: Steve Lime mailto:sdl...@gmail.com>>
Kopio: Mapserver 
mailto:mapserver-users@lists.osgeo.org>>
Aihe: Re: [mapserver-users] Use Ground Control Points from GeoTIFF

Hi

This is the mapfile:

MAP
NAME "map"
WEB
METADATA
"wms_title""WMS mapserver"
"wms_srs"  "EPSG:4326 EPSG:3021 EPSG: EPSG:3006 
EPSG:900913"
"wms_extent"   "1225000 613 191 7675000"
"wms_enable_request"   "*"
"wfs_enable_request"   "*"
END
END

PROJECTION
"init=epsg:4326"
END

EXTENT -180 -90 180 90

LAYER
  NAME "sat"
  DATA "sat.tif"
  TYPE RASTER
  STATUS ON

  METADATA
"wms_title" "sat"
  END

  PROJECTION
"init=epsg:4326"
  END
  EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146 
66.7744046276809797

END

END

I have also tried both without PROJECTION in LAYER and with
PROJECTION
 AUTO
END

None of them works.

EXTENT in the mapfile is taken from Qgis metadata of the layer.


Thanks
Jesper

Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime 
mailto:sdl...@gmail.com>>:
What does the mapfile look like?

On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe 
mailto:jesper.ke...@gmail.com>> wrote:
Hi

I have a GeoTiff file that gdalinfo presents like this:

gdalinfo sat.tif
Driver: GTiff/GeoTIFF
Files: sat.tif
Size is 10474, 10717
Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
  (0,0) -> (27.5783052509812,65.9184735836942,229.992792810313)
GCP[  1]: Id=2, Info=
  (524,0) -> (27.1416007200269,65.9731480840222,172.994255514815)
GCP[  2]: Id=3, Info=
  (1048,0) -> (26.7005564512604,66.0268770755367,152.994545626454)
GCP[  3]: Id=4, Info=
  (1572,0) -> (26.257537545879,66.0793551447287,131.994995356537)
GCP[  4]: Id=5, Info=
  (2096,0) -> (25.8102107755995,66.1308402121171,163.993212723173)


with 482 GCPs.


The file opens ok in Qgis and is located in the right location.
But I can´t in any way get it to show correctly in Mapserver.

Is this possible to do? Or do I have to gdalwarp the file to a known projection 
and set the PROJECTION of the layer?

Thanks
Jesper


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-02 Thread Jeff McKenna
I'm curious what happens when you try to generate a map image from the 
commandline: shp2img -m test.map -o ttt.png -all_debug 5


-jeff



--
Jeff McKenna
MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/



On 2020-09-02 4:51 a.m., Jesper Kempe wrote:

Hi

This is the mapfile:

MAP
     NAME "map"
     WEB
         METADATA
             "wms_title"            "WMS mapserver"
             "wms_srs"              "EPSG:4326 EPSG:3021 EPSG: 
EPSG:3006 EPSG:900913"

             "wms_extent"           "1225000 613 191 7675000"
             "wms_enable_request"   "*"
             "wfs_enable_request"   "*"
         END
     END

     PROJECTION
         "init=epsg:4326"
     END

     EXTENT -180 -90 180 90

     LAYER
       NAME "sat"
       DATA "sat.tif"
       TYPE RASTER
       STATUS ON

       METADATA
                 "wms_title" "sat"
       END

       PROJECTION
         "init=epsg:4326"
       END
       EXTENT 17.0473154408269387 62.1606759790530177 
27.5792082876237146 66.7744046276809797


     END

END

I have also tried both without PROJECTION in LAYER and with
PROJECTION
      AUTO
END

None of them works.

EXTENT in the mapfile is taken from Qgis metadata of the layer.


Thanks
Jesper

Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime >:


What does the mapfile look like?

On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe mailto:jesper.ke...@gmail.com>> wrote:

Hi

I have a GeoTiff file that gdalinfo presents like this:

gdalinfo sat.tif
Driver: GTiff/GeoTIFF
Files: sat.tif
Size is 10474, 10717
Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
     DATUM["WGS_1984",
         SPHEROID["WGS 84",6378137,298.257223563,
             AUTHORITY["EPSG","7030"]],
         AUTHORITY["EPSG","6326"]],
     PRIMEM["Greenwich",0],
     UNIT["degree",0.0174532925199433],
     AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
           (0,0) ->
(27.5783052509812,65.9184735836942,229.992792810313)
GCP[  1]: Id=2, Info=
           (524,0) ->
(27.1416007200269,65.9731480840222,172.994255514815)
GCP[  2]: Id=3, Info=
           (1048,0) ->
(26.7005564512604,66.0268770755367,152.994545626454)
GCP[  3]: Id=4, Info=
           (1572,0) ->
(26.257537545879,66.0793551447287,131.994995356537)
GCP[  4]: Id=5, Info=
           (2096,0) ->
(25.8102107755995,66.1308402121171,163.993212723173)


with 482 GCPs.


The file opens ok in Qgis and is located in the right location.
But I can´t in any way get it to show correctly in Mapserver.

Is this possible to do? Or do I have to gdalwarp the file to a
known projection and set the PROJECTION of the layer?

Thanks
Jesper






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-03 Thread Jesper Kempe
shp2img creates an empty blank image with a mapfile like this:

MAP
NAME "map"
WEB
METADATA
"wms_title""WMS mapserver"
"wms_srs"  "EPSG:4326 EPSG:3021 EPSG: EPSG:3006
EPSG:900913"
"wms_extent"   "1225000 613 191 7675000"
"wms_enable_request"   "*"
"wfs_enable_request"   "*"
END
END

PROJECTION
"init=epsg:4326"
END

EXTENT 15 60 30 68
SIZE 200 200

LAYER
  NAME "sat"
  DATA "/data/temp/Jesper/sat.tif"
  TYPE RASTER
  STATUS DEFAULT

  METADATA
"wms_title" "sat"
  END
END


The output from shp2img looks like this:

$ shp2img -m ttt.map -o /data/temp/Jesper/ttt.png -all_debug 5
msLoadMap(): 0.003s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msDrawRasterLayerGDAL(): Entering transform.
msDrawRasterLayerGDAL(): src=15,10645,15,15, dst=0,0,200,200
msDrawRasterLayerGDAL(): source raster PL (14.962,10645.462) for dst PL
(0,0).
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 0.011s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.011s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.003s
msFreeMap(): freeing map at 0x1d14f50.
freeLayer(): freeing layer at 0x1d1d080.
freeLayer(): freeing layer at 0x1d1e1b0.
shp2img total time: 0.017s


If I add:
  PROJECTION
"init=epsg:4326"
  END
  EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146
66.7744046276809797

shp2img outputs:

msLoadMap(): 0.003s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msDrawRasterLayerGDAL(): Entering transform.
msDrawRasterLayerGDAL(): src=0,0,10474,10717, dst=27,63,140,61
msDrawRasterLayerGDAL(): source raster PL (-49.554,-33.774) for dst PL
(27,63).
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 0.025s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.025s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.004s
msFreeMap(): freeing map at 0x2453f50.
freeLayer(): freeing layer at 0x245c080.
freeLayer(): freeing layer at 0x245d430.
shp2img total time: 0.033s

Then the image is shown in ttt.png but is not in the correct place and not
rotated correctly.

Any help or ideas are appreciated!

Thanks
Jesper

Den ons 2 sep. 2020 kl 18:23 skrev Jeff McKenna <
jmcke...@gatewaygeomatics.com>:

> I'm curious what happens when you try to generate a map image from the
> commandline: shp2img -m test.map -o ttt.png -all_debug 5
>
> -jeff
>
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> co-founder of FOSS4G
> http://gatewaygeo.com/
>
>
>
> On 2020-09-02 4:51 a.m., Jesper Kempe wrote:
> > Hi
> >
> > This is the mapfile:
> >
> > MAP
> >  NAME "map"
> >  WEB
> >  METADATA
> >  "wms_title""WMS mapserver"
> >  "wms_srs"  "EPSG:4326 EPSG:3021 EPSG:
> > EPSG:3006 EPSG:900913"
> >  "wms_extent"   "1225000 613 191 7675000"
> >  "wms_enable_request"   "*"
> >  "wfs_enable_request"   "*"
> >  END
> >  END
> >
> >  PROJECTION
> >  "init=epsg:4326"
> >  END
> >
> >  EXTENT -180 -90 180 90
> >
> >  LAYER
> >NAME "sat"
> >DATA "sat.tif"
> >TYPE RASTER
> >STATUS ON
> >
> >METADATA
> >  "wms_title" "sat"
> >END
> >
> >PROJECTION
> >  "init=epsg:4326"
> >END
> >EXTENT 17.0473154408269387 62.1606759790530177
> > 27.5792082876237146 66.7744046276809797
> >
> >  END
> >
> > END
> >
> > I have also tried both without PROJECTION in LAYER and with
> > PROJECTION
> >   AUTO
> > END
> >
> > None of them works.
> >
> > EXTENT in the mapfile is taken from Qgis metadata of the layer.
> >
> >
> > Thanks
> > Jesper
> >
> > Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime  > >:
> >
> > What does the mapfile look like?
> >
> > On Tue, Sep 1, 2020 at 10:26 AM Jesper Kempe  > > wrote:
> >
> > Hi
> >
> > I have a GeoTiff file that gdalinfo presents like this:
> >
> > gdalinfo sat.tif
> > Driver: GTiff/GeoTIFF
> > Files: sat.tif
> > Size is 10474, 10717
> > Coordinate System is `'
> > GCP Projection =
> > GEOGCS["WGS 84",
> >  DATUM["WGS_1984",
> >  SPHEROID["WGS 84",6378137,298.257223563,
> >  AUTHORITY["EPSG","7030"]],
> >  AUTHORITY["EPSG","6326"]],
> >  PRIMEM["Greenwich",0],
> >  UNIT["degree",0.0174532925199433],
> >  AUTHORITY["EPSG","4326"]]
> > GCP[  0]: Id=1, Info=
> >(0,0) ->
> >

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-03 Thread Rahkonen Jukka (MML)
Hi,

I would appreciate if you could have a try with
"gdalwarp -of vrt -t_srs "EPSG:3857" sat.tif sat_3857.vrt"

-Jukka Rahkonen-

Lähettäjä: mapserver-users  Puolesta 
Jesper Kempe
Lähetetty: torstai 3. syyskuuta 2020 13.57
Vastaanottaja: Jeff McKenna 
Kopio: Mapserver 
Aihe: Re: [mapserver-users] Use Ground Control Points from GeoTIFF

shp2img creates an empty blank image with a mapfile like this:

MAP
NAME "map"
WEB
METADATA
"wms_title""WMS mapserver"
"wms_srs"  "EPSG:4326 EPSG:3021 EPSG: EPSG:3006 
EPSG:900913"
"wms_extent"   "1225000 613 191 7675000"
"wms_enable_request"   "*"
"wfs_enable_request"   "*"
END
END

PROJECTION
"init=epsg:4326"
END

EXTENT 15 60 30 68
SIZE 200 200

LAYER
  NAME "sat"
  DATA "/data/temp/Jesper/sat.tif"
  TYPE RASTER
  STATUS DEFAULT

  METADATA
"wms_title" "sat"
  END
END


The output from shp2img looks like this:

$ shp2img -m ttt.map -o /data/temp/Jesper/ttt.png -all_debug 5
msLoadMap(): 0.003s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msDrawRasterLayerGDAL(): Entering transform.
msDrawRasterLayerGDAL(): src=15,10645,15,15, dst=0,0,200,200
msDrawRasterLayerGDAL(): source raster PL (14.962,10645.462) for dst PL (0,0).
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 0.011s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.011s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.003s
msFreeMap(): freeing map at 0x1d14f50.
freeLayer(): freeing layer at 0x1d1d080.
freeLayer(): freeing layer at 0x1d1e1b0.
shp2img total time: 0.017s


If I add:
  PROJECTION
"init=epsg:4326"
  END
  EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146 
66.7744046276809797

shp2img outputs:

msLoadMap(): 0.003s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msDrawRasterLayerGDAL(): Entering transform.
msDrawRasterLayerGDAL(): src=0,0,10474,10717, dst=27,63,140,61
msDrawRasterLayerGDAL(): source raster PL (-49.554,-33.774) for dst PL (27,63).
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 0.025s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.025s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.004s
msFreeMap(): freeing map at 0x2453f50.
freeLayer(): freeing layer at 0x245c080.
freeLayer(): freeing layer at 0x245d430.
shp2img total time: 0.033s

Then the image is shown in ttt.png but is not in the correct place and not 
rotated correctly.

Any help or ideas are appreciated!

Thanks
Jesper

Den ons 2 sep. 2020 kl 18:23 skrev Jeff McKenna 
mailto:jmcke...@gatewaygeomatics.com>>:
I'm curious what happens when you try to generate a map image from the
commandline: shp2img -m test.map -o ttt.png -all_debug 5

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/



On 2020-09-02 4:51 a.m., Jesper Kempe wrote:
> Hi
>
> This is the mapfile:
>
> MAP
>  NAME "map"
>  WEB
>  METADATA
>  "wms_title""WMS mapserver"
>  "wms_srs"  "EPSG:4326 EPSG:3021 EPSG:
> EPSG:3006 EPSG:900913"
>  "wms_extent"   "1225000 613 191 7675000"
>  "wms_enable_request"   "*"
>  "wfs_enable_request"   "*"
>  END
>  END
>
>  PROJECTION
>  "init=epsg:4326"
>  END
>
>  EXTENT -180 -90 180 90
>
>  LAYER
>NAME "sat"
>DATA "sat.tif"
>TYPE RASTER
>STATUS ON
>
>METADATA
>  "wms_title" "sat"
>END
>
>PROJECTION
>  "init=epsg:4326"
>END
>EXTENT 17.0473154408269387 62.1606759790530177
> 27.5792082876237146 66.7744046276809797
>
>  END
>
> END
>
> I have also tried both without PROJECTION in LAYER and with
> PROJECTION
>   AUTO
> END
>
> None of them works.
>
> EXTENT in the mapfile is taken from Qgis metadata of the layer.
>
>
> Thanks
> Jesper
>
> Den tis 1 sep. 2020 kl 23:41 skrev Steve Lime 
> mailto:sdl...@gmail.com>
> <mailto:sdl...@gmail.com<mailto:sdl...@gmail.com>>>:
>
> What

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-03 Thread Jesper Kempe
Hi Jukka

Sorry about that, I forgot that yesterday.

I did a test now and that actually works!

Changing DATA to the vrt-file and setting

PROJECTION
  "init=epsg:3857"
END

creates an image with sat.tif placed correctly!

$ shp2img -m icesat.map -o /data/temp/Jesper/ttt.png -all_debug 5
msLoadMap(): 0.014s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msResampleGDALToMap in effect: cellsize = 4202.211585
msDrawGDAL(sat): using RAW_WINDOW=0 0 12531 12770, dst=0,0,279,284
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 557.242s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 557.243s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.119s
msFreeMap(): freeing map at 0x7b1f50.
freeLayer(): freeing layer at 0x7ba080.
freeLayer(): freeing layer at 0x7bb760.
shp2img total time: 557.378s

BUT, note 557.378s on the last row...

Also a WMS-request works but takes about 4 minutes to complete!

It looks like I need to reproject all files new GeoTIFFs to get a decent
speed.

Thanks for all the replies!

Jesper


Den tors 3 sep. 2020 kl 13:31 skrev Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi>:

> Hi,
>
>
>
> I would appreciate if you could have a try with
>
> "gdalwarp -of vrt -t_srs "EPSG:3857" sat.tif sat_3857.vrt"
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* mapserver-users  
> *Puolesta
> *Jesper Kempe
> *Lähetetty:* torstai 3. syyskuuta 2020 13.57
> *Vastaanottaja:* Jeff McKenna 
> *Kopio:* Mapserver 
> *Aihe:* Re: [mapserver-users] Use Ground Control Points from GeoTIFF
>
>
>
> shp2img creates an empty blank image with a mapfile like this:
>
>
>
> MAP
> NAME "map"
> WEB
> METADATA
> "wms_title""WMS mapserver"
> "wms_srs"  "EPSG:4326 EPSG:3021 EPSG:
> EPSG:3006 EPSG:900913"
> "wms_extent"   "1225000 613 191 7675000"
> "wms_enable_request"   "*"
> "wfs_enable_request"   "*"
> END
> END
>
> PROJECTION
> "init=epsg:4326"
> END
>
> EXTENT 15 60 30 68
> SIZE 200 200
>
> LAYER
>   NAME "sat"
>   DATA "/data/temp/Jesper/sat.tif"
>   TYPE RASTER
>   STATUS DEFAULT
>
>   METADATA
> "wms_title" "sat"
>   END
> END
>
>
>
>
>
> The output from shp2img looks like this:
>
>
>
> $ shp2img -m ttt.map -o /data/temp/Jesper/ttt.png -all_debug 5
> msLoadMap(): 0.003s
> msDrawMap(): rendering using outputformat named png (AGG/PNG).
> msDrawRasterLayerLow(sat): entering.
> msDrawRasterLayerGDAL(): Entering transform.
> msDrawRasterLayerGDAL(): src=15,10645,15,15, dst=0,0,200,200
> msDrawRasterLayerGDAL(): source raster PL (14.962,10645.462) for dst PL
> (0,0).
> msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
> msDrawMap(): Layer 0 (sat), 0.011s
> msDrawMap(): Drawing Label Cache, 0.000s
> msDrawMap() total time: 0.011s
> msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.003s
> msFreeMap(): freeing map at 0x1d14f50.
> freeLayer(): freeing layer at 0x1d1d080.
> freeLayer(): freeing layer at 0x1d1e1b0.
> shp2img total time: 0.017s
>
>
>
>
>
> If I add:
>
>   PROJECTION
> "init=epsg:4326"
>   END
>   EXTENT 17.0473154408269387 62.1606759790530177 27.5792082876237146
> 66.7744046276809797
>
>
>
> shp2img outputs:
>
>
>
> msLoadMap(): 0.003s
> msDrawMap(): rendering using outputformat named png (AGG/PNG).
> msDrawRasterLayerLow(sat): entering.
> msDrawRasterLayerGDAL(): Entering transform.
> msDrawRasterLayerGDAL(): src=0,0,10474,10717, dst=27,63,140,61
> msDrawRasterLayerGDAL(): source raster PL (-49.554,-33.774) for dst PL
> (27,63).
> msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
> msDrawMap(): Layer 0 (sat), 0.025s
> msDrawMap(): Drawing Label Cache, 0.000s
> msDrawMap() total time: 0.025s
> msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.004s
> msFreeMap(): freeing map at 0x2453f50.
> freeLayer(): freeing layer at 0x245c080.
> freeLayer(): freeing layer at 0x245d430.
> shp2img total time: 0.033s
>
>
>
> Then the image is shown in ttt.png but is not in the correct place and not
> rotated correctly.
>
>
>
> Any help or ideas are appreciated!
>
>
>
> Thanks
>
> Jesper
>
>
>
> Den ons 2 sep. 2020 kl 18:23 skrev Jeff McKenna <
> jmcke..

Re: [mapserver-users] Use Ground Control Points from GeoTIFF

2020-09-03 Thread Rahkonen Jukka (MML)
Hi Jesper,

Poor performance may mean that your original tiff is not optimized for server 
usage and you should rewrite it in any case or at least add some overviews. 
Gdalinfo report about the original tiff and .vrt would probably give some 
useful information. If you select to warp images physically (would be my choise 
BTW) please try to do it right. You should find good GDAL commands from these 
slides 
https://www.slideshare.net/geosolutions/geoserver-on-steroids-foss4g-2015.

-Jukka Rahkonen-

Lähettäjä: Jesper Kempe mailto:jesper.ke...@gmail.com>>
Lähetetty: torstai 3. syyskuuta 2020 15.18
Vastaanottaja: Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>
Kopio: Jeff McKenna 
mailto:jmcke...@gatewaygeomatics.com>>; 
Mapserver 
mailto:mapserver-users@lists.osgeo.org>>
Aihe: Re: [mapserver-users] Use Ground Control Points from GeoTIFF

Hi Jukka

Sorry about that, I forgot that yesterday.

I did a test now and that actually works!

Changing DATA to the vrt-file and setting

PROJECTION
  "init=epsg:3857"
END

creates an image with sat.tif placed correctly!

$ shp2img -m icesat.map -o /data/temp/Jesper/ttt.png -all_debug 5
msLoadMap(): 0.014s
msDrawMap(): rendering using outputformat named png (AGG/PNG).
msDrawRasterLayerLow(sat): entering.
msResampleGDALToMap in effect: cellsize = 4202.211585
msDrawGDAL(sat): using RAW_WINDOW=0 0 12531 12770, dst=0,0,279,284
msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
msDrawMap(): Layer 0 (sat), 557.242s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 557.243s
msSaveImage(/data/temp/Jesper/ttt.png) total time: 0.119s
msFreeMap(): freeing map at 0x7b1f50.
freeLayer(): freeing layer at 0x7ba080.
freeLayer(): freeing layer at 0x7bb760.
shp2img total time: 557.378s

BUT, note 557.378s on the last row...

Also a WMS-request works but takes about 4 minutes to complete!

It looks like I need to reproject all files new GeoTIFFs to get a decent speed.

Thanks for all the replies!

Jesper


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users