From: Oleksandr H. <guz...@gm...> - 2013-01-30 03:07:16
|
I like this explanation, http://gis.ess.washington.edu/data/raster/drg/tfw.html >From the numbers you've showed, your tif does seem to be in lat/lon. But still there are several (many?) datums (coordinate origins) (NAD83,NAD27). My guess the datums are different for your GPS points and tif. You have to know the projection of your data, otherwise you will have to experiment. You could reproject coordinates of the points to different CRS and see if they match the positions you need. The CRS info for the points should be specified when creating SimpleFeatureTypeBuilder ... if I remember correctly. Cheers -- Oleksandr (Sasha) Huziy 2013/1/29 Brian Behling <bri...@gm...> > I really dont work with GeoTiffs, but see this post... > > > gis.stackexchange.com/questions/35210/setting-projection-to-a-geotiff-file-when-its-shown-as-unknown. > > > You could probabaly reproject your tiff into whatever projection your GPS > points are using ArcMap, GDAL, Qgis. > > sent from 'droid > On Jan 29, 2013 7:08 PM, "David Purdy" <dav...@jj...> > wrote: > >> This is all that is in the tfw file:**** >> >> ** ** >> >> 0.0010810811**** >> >> 0.000000**** >> >> 0.000000**** >> >> -0.0010810811**** >> >> -77.2211469937**** >> >> 45.9782777361**** >> >> ** ** >> >> How would I know if the tiff is projected?**** >> >> ** ** >> >> *From:* guz...@gm... [mailto:guz...@gm...] >> *Sent:* Sunday, January 27, 2013 12:56 AM >> *To:* David Purdy; 'Brian Behling' >> *Cc:* geotools-gt2-users >> *Subject:* Re: [Geotools-gt2-users] Coordinate Reference System is not >> available issue...**** >> >> ** ** >> >> >> Hi, can you open the tfw file with text editor, maybe tiff is projected? >> Then you will have to specify( reproject) coordinates of points. >> -- >> Oleksandr Huziy >> Sent from my HTC**** >> >> ----- Reply message ----- >> From: "David Purdy" <dav...@jj...> >> To: "'Brian Behling'" <bri...@gm...> >> Cc: <geo...@li...> >> Subject: [Geotools-gt2-users] Coordinate Reference System is not >> available issue... >> Date: Sat, Jan 26, 2013 8:53 PM**** >> >> ** ** >> >> If projection information is only found in a .prj file then my GeoTiff >> image does not have it. How do I go about getting that info?**** >> >> Also, I am not sure what you mean by "GPS points are not projected but >> are in a geographic coordinate system such as WGS84"? **** >> >> ** ** >> >> I am basically doing the following to plot each point onto the map:**** >> >> ** ** >> >> *final* SimpleFeatureType point = createFeatureTypePoint();**** >> >> *final* SimpleFeatureBuilder BLDR = *new* SimpleFeatureBuilder(point);*** >> * >> >> Coordinate coord = *new*Coordinate(gpsData.getLongitude().doubleValue(), >> gpsData.getLatitude().doubleValue());**** >> >> pointCollection.add(createPoint(BLDR, coord, getPointId()));**** >> >> ** ** >> >> That createPoint method just uses GeometryFactory to create the point.*** >> * >> >> ** ** >> >> Thanks,**** >> >> Dave**** >> >> ** ** >> >> *From:* Brian Behling [mailto:bri...@gm...<bri...@gm...>] >> >> *Sent:* Saturday, January 26, 2013 7:34 PM >> *To:* David Purdy >> *Cc:* geo...@li... >> *Subject:* Re: [Geotools-gt2-users] Coordinate Reference System is not >> available issue...**** >> >> ** ** >> >> Does yur GeoTiff image have projection information? I think it may need a >> .prj file. **** >> >> Typically GPS points are not projected but are in a geographic coordinate >> system such as WGS84. **** >> >> sent from 'droid**** >> >> On Jan 26, 2013 4:49 PM, "David Purdy" <dav...@jj...> >> wrote:**** >> >> Hi All,**** >> >> **** >> >> I am working on an application that plots points from a GPS and has many >> other features.**** >> >> My issue is that the points being plotted on the chart seems to be off by >> a fairly decent amount. I would say somewhere in the order of 20 miles >> south or so from the actual GPS coordinates. I do notice that I am getting >> a warning displayed during reading of the TIFF image for the chart. The >> warning is: "WARNING: Coordinate Reference is not available". Is this >> warning the reason my plotted points are off from where they should be >> displayed? Or would that be because of some other reason? I don't see >> anywhere to define the coordinate reference system. I have poured over all >> of your tutorials to see if I am missing something. In this case, I am >> reading in 13001_3.tif and I also have a file named 13001_3.tfw in the same >> directory where I am reading from. Below is the code I have for reading >> the *.tif file:**** >> >> **** >> >> map = *new* MapContent();**** >> >> **** >> >> File rasterFile = *new* File(geoTiffFilesDir + "/" + selectedMapFile);*** >> * >> >> String rasterFilePath = rasterFile.getPath();**** >> >> rasterFilePath = rasterFilePath.replace('\\', '/');**** >> >> AbstractGridFormat format = GridFormatFinder.*findFormat*( rasterFile );* >> *** >> >> AbstractGridCoverage2DReader reader = format.getReader(rasterFile);**** >> >> **** >> >> StyleBuilder styleBuilder = *new* StyleBuilder();**** >> >> RasterSymbolizer rastSymbolizer = styleBuilder.createRasterSymbolizer();* >> *** >> >> Style style = styleBuilder.createStyle(rastSymbolizer);**** >> >> GridReaderLayer rasterLayer = *new* GridReaderLayer(reader, style);**** >> >> map.layers().add(layerIndex, rasterLayer); **** >> >> **** >> >> I appreciate any help!!**** >> >> **** >> >> Thanks,**** >> >> Dave**** >> >> **** >> >> --------------------------------------------**** >> >> *David Purdy***** >> >> *Owner/President***** >> >> *JJM Technologies Corporation***** >> >> *Email: dav...@jj...***** >> >> *Phone: 508.972.1266***** >> >> *[image: signatureLogo]***** >> >> **** >> >> >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. ON SALE this month only -- learn more at: >> http://p.sf.net/sfu/learnnow-d2d >> _______________________________________________ >> GeoTools-GT2-Users mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users**** >> > |