Re: [Geoserver-users] [EXT] Re: Failed to Add Raster Data Source

2019-08-16 Thread Marks, Constant
I created https://osgeo-org.atlassian.net/browse/GEOS-9305

The original tiff and associated files are attached.

Thanks for supporting this awesome map server project!

-C
From: Andrea Aime 
Sent: Friday, August 16, 2019 4:21 AM
To: Marks, Constant 
Cc: geoserver-users@lists.sourceforge.net
Subject: [EXT] Re: [Geoserver-users] Failed to Add Raster Data Source

On Fri, Aug 16, 2019 at 1:10 AM Marks, Constant 
mailto:constant.ma...@unt.edu>> wrote:
I found that adding the prj file fixed this problem thanks to this python 
script written by Mersey Viking found below.

My question then is why does geoserver need this file for some tifs and not for 
others?  Is there something about the header that is preventing geoserver from 
parsing the projection data?

May be, do you have a small sample file that can be shared? If so can you open 
a ticket on the issue tracker and attach the sample to it?

If so why not add these osgeo methods to the geoserver package?

For the simplest of the reasons normally, because it takes work, which besides 
some exceptions, in turn requires funding.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit 
http://goo.gl/it488V
 for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions 
S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: 
+39 0584 1660272 mob: +39 339 8844549 
http://www.geo-solutions.it
 
http://twitter.com/geosolutions_it
 --- Con riferimento alla 
normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento 
generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza 
inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è 
un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, 
ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene 
notizia. This email is intended only for the person or entity to which it is 
addressed and may contain information that is privileged, confidential or 
otherwise protected from disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or 
the information herein by anyone other than the intended recipient is 
prohibited. If you have received this email by mistake, please notify us 
immediately by telephone or e-mail.
___
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] [EXT] Re: Failed to Add Raster Data Source

2019-08-16 Thread Marks, Constant
How do I pull down the whole log?  Every time it gets an error I just see that 
“ ... 140 more”.

From: Jody Garnett 
Sent: Thursday, August 15, 2019 7:02 PM
To: Marks, Constant 
Cc: geoserver-users@lists.sourceforge.net
Subject: [EXT] Re: [Geoserver-users] Failed to Add Raster Data Source

In general we read spatial reference details out of the GeoTiff header (that is 
what makes it a GeoTIFF...). There must be a gap between what we implement and 
the tags in the header you are using. The log cuts off before I can see some 
kind of "caused by" detail in the stack trace ...

More detail/information would be required to determine if this is a bug in 
GeoServer or the provided file.
--
Jody Garnett


On Thu, 15 Aug 2019 at 16:03, Marks, Constant 
mailto:constant.ma...@unt.edu>> wrote:
I found that adding the prj file fixed this problem thanks to this python 
script written by Mersey Viking found below.

My question then is why does geoserver need this file for some tifs and not for 
others?  Is there something about the header that is preventing geoserver from 
parsing the projection data?  If so why not add these osgeo methods to the 
geoserver package?


# Written by MerseyViking (mersey dot viking at gmail dot com), 2011.

# Released into the public domain - May 8, 2011

# I accept no responsibility for any errors or loss of data, revenue, or life 
this script may cause. Use at your own risk.



import osgeo.gdal as gdal

import osgeo.osr as osr

import os

import glob

import sys



def generate_tfw(path, gen_prj):

for infile in glob.glob(os.path.join(path, '*.tif')):

src = gdal.Open(infile)

xform = src.GetGeoTransform()



if gen_prj == 'prj':

src_srs = osr.SpatialReference()

src_srs.ImportFromWkt(src.GetProjection())

src_srs.MorphToESRI()

src_wkt = src_srs.ExportToWkt()



prj = open(os.path.splitext(infile)[0] + '.prj', 'wt')

prj.write(src_wkt)

prj.close()

src = None

   edit1=xform[0]+xform[1]/2

   edit2=xform[3]+xform[5]/2



   tfw = open(os.path.splitext(infile)[0] + '.tfw', 'wt')

   tfw.write("%0.8f\n" % xform[1])

   tfw.write("%0.8f\n" % xform[2])

   tfw.write("%0.8f\n" % xform[4])

   tfw.write("%0.8f\n" % xform[5])

   tfw.write("%0.8f\n" % edit1)

   tfw.write("%0.8f\n" % edit2)

   tfw.close()



if __name__ == '__main__':

generate_tfw(sys.argv[1], sys.argv[2])


From: Marks, Constant
Sent: Thursday, August 15, 2019 2:03 PM
To: 
geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Failed to Add Raster Data Source

Hello all.   This may have come up before but I did not see a solution.  Thank 
in advance for your help!

I am struggling to add a GeoTiff raster file to Geoserver. After some 
transformations and adding color to the original GeoTiff (which would also not 
load) here are the details:

PERMISSIONS:
$ ls outputv2.tif -la
-rw-rw-rw- 1 nvidia nvidia 207210997 Aug 15 13:46 outputv2.tif

GDALINFO:
$ gdalinfo outputv2.tif
Driver: GTiff/GeoTIFF
Files: outputv2.tif
Size is 32410, 21019
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
BASEGEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]],
CONVERSION["Popular Visualisation Pseudo-Mercator",
METHOD["Popular Visualisation Pseudo Mercator",
ID["EPSG",1024]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["False easting",0,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["easting (X)",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["northing (Y)",north,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["unknown"],
AREA["World - 85°S to 85°N"],
BBOX[-85.06,-180,85.06,180]],
ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (-20037507.987483192235231,18434491.525901496410370)
Pixel Size = (1236.473576745130231,-1236.511728912020544)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=PACKBITS
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-20037507.987,18434491.526) (179d59'59.99"W, 83d38'22.73"N)
Lower Left  (-20037507.987,-7555748.504) (179d59'59.99"W, 55d59'11.76"S)
Upper Right (20036600.635,18434491.526) (179d59'30.65"