Re: [Geotools-gt2-users] DEM from points

2024-02-17 Thread Ian Turton
Yes, you can interpolate the points using a Barnes Surface - see
https://gis.stackexchange.com/questions/41197/creating-raster-by-interpolating-point-values-using-geotools

Ian

On Sat, 17 Feb 2024 at 06:33, sunish  wrote:

> Hello,
>
> I have a set of points with x y z coordinates on EPSG:4326 projection.
> Can I utilize GeoTools to generate elevation data in DEM format from the
> provided dataset?
>
> Could you please provide insights, how I should proceed.
>
>
>
> Thank You.
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools EPSG WKT plugin download?

2023-11-21 Thread Ian Turton
That link should be -
modules/plugin/epsg-wkt/src/main/resources/org/geotools/referencing/epsg/wkt/epsg.properties
if you want to update the docs

Ian

On Tue, 21 Nov 2023 at 09:21, Brad Hards  wrote:

> On Tuesday, 21 November 2023 8:04:53 PM AEDT Ron Lindhoudt via
> GeoTools-GT2-Users wrote:
> > Hello,
> > I notice that the EPSG WKT plugin is not part of the GeoTools bin
> download
> > anymore. File gt-epsg-wkt-*.jar Where can I download
> > it?See
> https://docs.geotools.org/latest/userguide/library/referencing/wkt.h
> > tml Thanks for any help.
>
> I just downloaded 30.0 from sourceforge.
>
> bradh@audax:~/Downloads$ unzip -q geotools-30.0-bin.zip
> bradh@audax:~/Downloads$ ls -l
> geotools-30.0/optional/gt-epsg-wkt-30.0.jar
> -rw-r--r-- 1 bradh bradh 259425 Oct 13 07:42
> geotools-30.0/optional/gt-epsg-wkt-30.0.jar
>
> (Note, not under lib/)
>
> HTH
>
> Brad
>
>
>
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools 30-RC release candidate available - please test!

2023-10-06 Thread Ian Turton
On Fri, 6 Oct 2023 at 17:20, Jody Garnett  wrote:

> Nice,
>
> Do you have examples of the 'ReferencedEnvelope.create(' lines that did
> not get picked up? Maybe we can adjust the script ..
>


They are split over 2 lines which I think caused the problem:

ReferencedEnvelope bounds = ReferencedEnvelope.create(new Envelope(xMin,
xMax, yMin, yMax),
coordinateReferenceSystem);

Ian

>
> I am going to get core-geonetwork today and report back.
>
> Jody
>
> On Fri, Oct 6, 2023 at 8:29 AM Ian Turton  wrote:
>
>>
>> Everything went pretty well in the repos I've tested - a few
>> `ReferencedEnvelope.creates(` didn't get picked up by the conversion tool
>> but nothing too severe
>>
>> Ian
>>
>>
>> On Sun, 1 Oct 2023 at 23:30, Jody Garnett  wrote:
>>
>>> Wow this has been a journey, the GeoTools Project Management committee -
>>> and especially the crew attending the Bolsena code sprint
>>> <https://www.osgeo.org/events/bolsena-code-sprint-2023/> are pleased to
>>> share the GeoTools 30-RC Release Candidate with you.
>>>
>>> The blog post is here:
>>> https://geotoolsnews.blogspot.com/2023/09/geotools-30-rc-released.html
>>>
>>> This is a very unusual and ambitious update for the GeoTools project -
>>> with some deliberate breaking API changes (gasp how rude). Indeed in
>>> response to a request from OGC members we are making some changes to the
>>> structure of our library.
>>>
>>> But fear not there is a script to help, from the user manual upgrade
>>> page <https://docs.geotools.org/stable/userguide/welcome/upgrade.html>:
>>>
>>> *ant -f remove-opengis.xml -Dproject.dir=(absolute path to your
>>> project directory)*
>>>
>>> As for the refactor:
>>>
>>>
>>>1. The package org.opengis has changed org.geotools.api.
>>>2. The main data access interfaces have been moved from
>>>org.geotools.data to org.geotools.api.data. This includes, DataStore,
>>>FeatureSource, FeatureIterator, and many others.
>>>As part of the move, the datastore registration files found in
>>>META-INF/services need to be moved as well.
>>>3. Most of the "org.geotools.metadata" package is gone, as these
>>>classes and interfaces were not used.
>>>4. Internationalized error message support has been removed.
>>>5. The org.opengis.geometry interfaces (for Point, Curve and Surface
>>>and supporting classes) were no longer in use. The direct use of JTS
>>>Topology Suite Geometry is now used throughout the library
>>>6. The org.opengis.geometry and org.opengis.geometry.coordinates
>>>interfaces for positions, envelopes and bounding boxes have been revised 
>>> as
>>>part of their refactor to org.geotools.api.
>>>7. The interface "org.opengis.geometry.Envelope" has been renamed
>>>"org.geotools.api.geometry.Bounds" and some of the confusion related to 
>>> the
>>>proliferation of envelope-related classes has been cleaned up.
>>>
>>>
>>> The nice thing is that after all this work the library is easier to use
>>> with dead code and duplication removed.
>>>
>>> We have had lots of great feedback from downstream projects and early
>>> testers - with this release candidate we wish to cast a wider net asking
>>> for YOUR help!
>>>
>>>
>>>- GeoWebCache
>>><https://github.com/GeoWebCache/geowebcache/issues/1151>
>>>- mapfish-print-v2
>>><https://github.com/GeoWebCache/geowebcache/issues/1151>
>>>- GeoMesa <https://geomesa.atlassian.net/browse/GEOMESA-3285> - project
>>>    has created a small script
>>><https://geomesa.atlassian.net/browse/GEOMESA-3285> to update Scala
>>>projects!
>>>- GeoServer <https://osgeo-org.atlassian.net/browse/GEOS-11070>
>>>- geotools-devel mailing list
>>>
>>>
>>> Please reply to this email with your success on running the script and
>>> updating to GeoTools 30-RC.
>>>
>>> We look forward to hearing from you!
>>> --
>>> GeoTools Project Management Committee
>>> ___
>>> GeoTools-GT2-Users mailing list
>>> GeoTools-GT2-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>
>>
>> --
>> Ian Turton
>>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools 30-RC release candidate available - please test!

2023-10-06 Thread Ian Turton
Everything went pretty well in the repos I've tested - a few
`ReferencedEnvelope.creates(` didn't get picked up by the conversion tool
but nothing too severe

Ian


On Sun, 1 Oct 2023 at 23:30, Jody Garnett  wrote:

> Wow this has been a journey, the GeoTools Project Management committee -
> and especially the crew attending the Bolsena code sprint
> <https://www.osgeo.org/events/bolsena-code-sprint-2023/> are pleased to
> share the GeoTools 30-RC Release Candidate with you.
>
> The blog post is here:
> https://geotoolsnews.blogspot.com/2023/09/geotools-30-rc-released.html
>
> This is a very unusual and ambitious update for the GeoTools project -
> with some deliberate breaking API changes (gasp how rude). Indeed in
> response to a request from OGC members we are making some changes to the
> structure of our library.
>
> But fear not there is a script to help, from the user manual upgrade page
> <https://docs.geotools.org/stable/userguide/welcome/upgrade.html>:
>
> *ant -f remove-opengis.xml -Dproject.dir=(absolute path to your
> project directory)*
>
> As for the refactor:
>
>
>1. The package org.opengis has changed org.geotools.api.
>2. The main data access interfaces have been moved from
>org.geotools.data to org.geotools.api.data. This includes, DataStore,
>FeatureSource, FeatureIterator, and many others.
>As part of the move, the datastore registration files found in
>META-INF/services need to be moved as well.
>3. Most of the "org.geotools.metadata" package is gone, as these
>classes and interfaces were not used.
>4. Internationalized error message support has been removed.
>5. The org.opengis.geometry interfaces (for Point, Curve and Surface
>and supporting classes) were no longer in use. The direct use of JTS
>Topology Suite Geometry is now used throughout the library
>6. The org.opengis.geometry and org.opengis.geometry.coordinates
>interfaces for positions, envelopes and bounding boxes have been revised as
>part of their refactor to org.geotools.api.
>7. The interface "org.opengis.geometry.Envelope" has been renamed
>"org.geotools.api.geometry.Bounds" and some of the confusion related to the
>proliferation of envelope-related classes has been cleaned up.
>
>
> The nice thing is that after all this work the library is easier to use
> with dead code and duplication removed.
>
> We have had lots of great feedback from downstream projects and early
> testers - with this release candidate we wish to cast a wider net asking
> for YOUR help!
>
>
>- GeoWebCache <https://github.com/GeoWebCache/geowebcache/issues/1151>
>- mapfish-print-v2
><https://github.com/GeoWebCache/geowebcache/issues/1151>
>- GeoMesa <https://geomesa.atlassian.net/browse/GEOMESA-3285> - project
>has created a small script
><https://geomesa.atlassian.net/browse/GEOMESA-3285> to update Scala
>projects!
>- GeoServer <https://osgeo-org.atlassian.net/browse/GEOS-11070>
>- geotools-devel mailing list
>
>
> Please reply to this email with your success on running the script and
> updating to GeoTools 30-RC.
>
> We look forward to hearing from you!
> --
> GeoTools Project Management Committee
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] GeoTools 29.2 & GeoServer 2.23.2 released

2023-07-24 Thread Ian Turton
GeoTools 29.2 has been released as the new stable release of the library -
more details at the blog
<https://geotoolsnews.blogspot.com/2023/07/geotools-292-released.html>,
GeoWebCache 1.23.1 and GeoServer 2.23.2 are also released based on this
release. Full details of the GeoServer release including two security
related issues are available at the GeoServer blog
<https://geoserver.org/announcements/2023/07/21/geoserver-2-23-2-released.html>
.

We encourage all users to upgrade as soon as possible.

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Converter Available?

2023-07-03 Thread Ian Turton
I looked at them briefly a few years ago and wrote about it
https://blog.ianturton.com/location/rest/mapping/2015/08/18/Comparing-Locationcodes.html

Ian

On Sun, 2 Jul 2023 at 22:22, Dennis Gesker  wrote:

> Is there a converter available for "plus codes
> <https://maps.google.com/pluscodes/>?"
>
> Looking for a converter or a snippet to flip a WGS84 Coordinate to a "Plus
> code." Was hoping there was a call/method similar to getSRID() on a point
> geometry.
>
> Or, if anyone has a snippet that would be awesome.
>
> Dennis
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Latest Releases 29.1 and 2.23.1

2023-05-26 Thread Ian Turton
We're pleased to announce the (slightly delayed) release of the latest
stable versions of GeoTools (29.1) and GeoServer (2.23.1) both release
contain a number of bug fixes and enhancements so you are encouraged to
upgrade to them. More details are available in the related blog posts -
GeoTools (https://geotoolsnews.blogspot.com/) and GeoServer (
https://geoserver.org/announcements/2023/05/23/geoserver-2-23-1-released.html
)

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Introduction to GeoTools swing tools

2023-05-10 Thread Ian Turton
That sounds like a great addition, I have a feeling that I planned to go
back and do that when I added mouse wheel support, but never got around to
it.

Ian

On Wed, 10 May 2023, 00:37 Leif Gruenwoldt,  wrote:

> This is really cool Ian.
>
> My team use the geotools swing example in a couple of our projects,
> it's great to see tutorials like this. This is really helpful.
>
> As an aside, I've been meaning to submit a pull request for the swing
> example that improves the zoom tool to make it behave like Google Maps
> (and most any other modern GIS). It makes the mouse wheel zoom in
> relative to the cursor position in the window.
>
>
> Leif
>
>
>
> On Mon, May 8, 2023 at 10:20 AM Ian Turton  wrote:
> >
> > If you ever wondered how to add a tool to the GeoTools swing map then
> I've written a short introduction to it. There is also a link to a small
> project that provides a tool to draw lines on a map.
> >
> > See
> https://blog.ianturton.com/geotools/2023/05/08/drawing-on-a-geotools-map.html
> for all the gory details.
> >
> > cheers
> >
> > Ian
> >
> > --
> > Ian Turton
> > ___
> > GeoTools-GT2-Users mailing list
> > GeoTools-GT2-Users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Introduction to GeoTools swing tools

2023-05-08 Thread Ian Turton
If you ever wondered how to add a tool to the GeoTools swing map then I've
written a short introduction to it. There is also a link to a small project
that provides a tool to draw lines on a map.

See
https://blog.ianturton.com/geotools/2023/05/08/drawing-on-a-geotools-map.html
for all the gory details.

cheers

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geometry or WKT or SimpleFeature encode to GML in GeoTools 20.5

2023-05-03 Thread Ian Turton
t.toString());
>
> } *catch* (ParseException e1) {
>
>   // *TODO* Auto-generated catch block
>
>   e1.printStackTrace();
>
> }
>
>
>
> I have also tried:
>   *public* String convertSimpleFeatureToGML(SimpleFeature
> simpleFeature) {
>
>   GMLConfiguration gmlConfiguration = *new* GMLConfiguration(
> *true*);
>
> Geometry geom = (Geometry) simpleFeature.getDefaultGeometry();
>
>
>
>   Encoder encoder = *new* Encoder(gmlConfiguration);
>
>   ByteArrayOutputStream boas = *new* ByteArrayOutputStream();
>
>   *try* {
>
>   encoder.encode(geom, GML.*MultiPolygon*, boas);
>
>   *return* boas.toString();
>
>   } *catch* (IOException e) {
>
>   e.printStackTrace();
>
>   *return* "";
>
>   }
>
>
>
>   }
>
> And then calling this function with a simpleFeature that contains the
> multipolygon described above in the WKT.
>
>
>
> If anyone can help me, it would be greatly appreciated.
>
>
>
> Kind Regards / Met vriendelijke groet,
>
> *Asset People B.V.*
>
>
>
> *Mieke Zwart*
>
>
>
> M. +31 (0) 612 967 788
>
> E. mieke.zw...@assetpeople.com
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Relicensing to LPGLv2.1-or-later

2023-02-16 Thread Ian Turton
On Thu, 16 Feb 2023 at 01:39, Jody Garnett  wrote:

> We can discuss this at the next group meeting; can you open a ticket with
> details of what is required? The project also welcomes pull-requests if you
> are in position to identify the files and propose the change.
>
> We have also had requests to relicense to apache 2.0; as that meets our
> original goal of a permissive license.
>

Our (i.e. James and I) original goal was not a permissive license but an
explicit share alike license.

Christian, can you explain exactly what the benefits of moving to a later
LGPL license would be for you? what would you like to do with the code that
you are unable to do currently?

Ian


> --
>


> Jody Garnett
>
>
> On Tue, Feb 14, 2023 at 3:27 AM Christian Raack  wrote:
>
>> Dear GeoTools-Team,
>>
>> Is it possible to relicense files packaged with geotools that are limited
>> to LGPLv2.1
>> in such a way that they can be used under LGPLv2.1 or later?
>>
>> Background:
>>
>> We would like to use geotools by default for our software product, the
>> atesio-fttx-optimizer
>> which is a backend optimization platform in the area of planning FTTx
>> (fiber to the x)
>> telecommunication networks. We would link it as a java library without
>> changes to the code.
>>
>> Your website states that you are using the LGPL license.
>> Many of the provided files (if a license is explicitly stated in the file)
>> are in fact under LGPLv2.1.
>>
>> More precisely, in some cases you restrict to LGPLv2.1 only as in
>>
>> org.geotools.data.AllQuery.java  (LGPLv2.1-only)
>>
>> In other cases you allow the use with LGPLv2.1 or any later version
>>
>>org.opengis.filter.capability.FilterCapabilities.java
>> (LGPLv2.1-or-later)
>>
>> In addition, we partially find third party code with licenses such as
>>- LGPL 3.0
>>- Apache-2.0
>>- Public Domain
>>- WTFPL
>>- MIT
>>- BSD-3-Clause
>>
>> where you add LGPLv2.1-only to the original license, see for instance
>>
>>   org.geotools.xml.impl.DatatypeConverterImpl.java:
>>
>> /*
>>*GeoTools - The Open Source Java GIS Toolkit
>>*http://geotools.org
>>*
>>*(C) 2019, Open Source Geospatial Foundation (OSGeo)
>>*
>>*This library is free software; you can redistribute it and/or
>>*modify it under the terms of the GNU Lesser General Public
>>*License as published by the Free Software Foundation;
>>*version 2.1 of the License.
>>*
>>*This library is distributed in the hope that it will be useful,
>>*but WITHOUT ANY WARRANTY; without even the implied warranty of
>>*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>>*Lesser General Public License for more details.
>>*/
>> /*
>>* Copyright 2003-2016  The Apache Software Foundation
>>*
>>* Licensed under the Apache License, Version 2.0 (the "License");
>>* you may not use this file except in compliance with the License.
>>* You may obtain a copy of the License at
>>*
>>* http://www.apache.org/licenses/LICENSE-2.0
>>*
>>* Unless required by applicable law or agreed to in writing, software
>>* distributed under the License is distributed on an "AS IS" BASIS,
>>* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>* See the License for the specific language governing permissions and
>>* limitations under the License.
>>*
>>*/
>>
>>
>> This however is not consistent, as Apache 2.0 is not compatible with
>> LGPLv2.1-only,
>> see for instance
>> https://www.gnu.org/licenses/license-list.html.en#apache2.
>> Notice that in such a case there is no problem when using
>> LGPLv2.1-or-later instead
>> ("version 2.1 of the License, OR **(at your option) any later version**")
>> because
>> there are later versions of the LGPL that are compatible with Apache 2.0.
>>
>> To avoid any license issues it would be a solution that those files which
>> are licensed
>> under "LGPL-2.1-only" are relicensed
>>
>> ** under LGPLv2.1 or later **.
>>
>> This would ensure compatibility with Apache 2.0 as well as the
>> alternative licenses above.
>>
>> Could you relicense the respective files under "LGPLv2.1-or-later" or
>> would you give us indi

Re: [Geotools-gt2-users] Failed to execute request to WMTS

2022-11-30 Thread Ian Turton
But that's for the legend image (and again probably should be an integer) -
I can't think of any reason why the WMTS reader would be using that. You
really need to turn logging up to fine or finest and see how it is getting
there.

Ian

On Wed, 30 Nov 2022 at 14:55, Roar Brænden 
wrote:

> Hi,
>
> It seems like this height=85.5 is coming from the capabilities document.
> Here for instance:
>
> 
> <ows:Title xml:lang="en">default</ows:Title>
> <ows:Identifier>default</ows:Identifier>
> <LegendURL width="378" xlink:href="
> <a  rel="nofollow" href="https://gibs.earthdata.nasa.gov/legends/AMSU_Brightness_Temp_H.svg&quot">https://gibs.earthdata.nasa.gov/legends/AMSU_Brightness_Temp_H.svg&quot</a>;
> xlink:role="<a  rel="nofollow" href="http://earthdata.nasa.gov/gibs/legend-type/horizontal&quot">http://earthdata.nasa.gov/gibs/legend-type/horizontal&quot</a>; height
> ="85.5" format="image/svg+xml" xlink:title="GIBS Color Map Legend:
> Horizontal" xlink:type="simple"/>
> <LegendURL width="135" xlink:href="
> <a  rel="nofollow" href="https://gibs.earthdata.nasa.gov/legends/AMSU_Brightness_Temp_V.svg&quot">https://gibs.earthdata.nasa.gov/legends/AMSU_Brightness_Temp_V.svg&quot</a>;
> xlink:role="<a  rel="nofollow" href="http://earthdata.nasa.gov/gibs/legend-type/vertical&quot">http://earthdata.nasa.gov/gibs/legend-type/vertical&quot</a>; height="
> 288" format="image/svg+xml" xlink:title="GIBS Color Map Legend: Vertical"
> xlink:type="simple"/>
> 
>
> Haven't looked in the WMTS specification to see if that is against the
> rules, but sure isn't anything the user could fix. Geotools is tolerant
> elsewhere, so it could certainly be a place for a little flexibility. Not
> sure how to handle it though.
>
> Best regards,
>
> Roar Brænden
>
>
> 30. nov. 2022 kl. 10:11 skrev Ian Turton :
>
> Height is in pixels and is an integer value so your value of 85.5 is a
> problem, your code example doesn't show how you are generating the size
> request but I would expect a height/width of 255 or 512 for a WMTS request.
> It's possible that the GeoTools WMTS code doesn't understand the TIME
> dimension or the value RESTful as an encoding, you'll need to turn the
> logging level up to find out exactly why that URL is being used.
>
> Ian
>
> On Wed, 30 Nov 2022 at 08:45, Daniel Kindermann 
> wrote:
>
>> Hello GeoTools community,
>>
>> I'm new to GeoTools. Currently I'm trying to establish a connection to a
>> WMTS. I followed the instructions in the WMTS — GeoTools 28-SNAPSHOT
>> User Guide
>> <https://docs.geotools.org/stable/userguide/extension/wmts/index.html#wmtstileservice>.
>> Unfortunately the request to the WMTS failes.
>>
>> *Here are my system information:*
>>
>> GeoTools version 28-SNAPSHOT (built from
>> r175672287370cf2c54eb30f2bbaa04f743835523)
>> Java version: 17.0.4.1
>> Operating system: Windows 10 10.0
>> GeoTools jars on classpath:
>>
>> I use Maven. My pom.xml is pretty much the one from the quickstart
>> tutorial but of course I added the gt-wmts dependency.
>>
>> *Here is my error message:*
>>
>> Nov. 30, 2022 9:39:18 AM org.geotools.data.ows.AbstractOpenWebService
>> internalIssueRequest
>> SCHWERWIEGEND: Failed to execute request
>> https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi?REQUEST=GetCapabilities=1.0.0=WMTS
>> Exception in thread "main" java.lang.RuntimeException: Parsing failed for
>> height: java.lang.NumberFormatException: For input string: "85.5"
>> at org.geotools.xsd.impl.ParseExecutor.visit(ParseExecutor.java:153)
>> at
>> org.geotools.xsd.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:218)
>> at org.geotools.xsd.impl.BindingWalker.walk(BindingWalker.java:184)
>> at org.geotools.xsd.impl.BindingWalker.walk(BindingWalker.java:188)
>> at
>> org.geotools.xsd.impl.ElementHandlerImpl.startElement(ElementHandlerImpl.java:180)
>> at
>> org.geotools.xsd.impl.ParserHandler.startElement(ParserHandler.java:378)
>> at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
>> at
>> java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
>> at
>> java.xml/com.sun.org.apache.xerces.int

Re: [Geotools-gt2-users] Failed to execute request to WMTS

2022-11-30 Thread Ian Turton
; at
> org.geotools.data.ows.AbstractOpenWebService.(AbstractOpenWebService.java:77)
> at
> org.geotools.ows.wmts.WebMapTileServer.(WebMapTileServer.java:151)
> at org.geotools.tutorial.App.main(App.java:28)
> Caused by: java.lang.NumberFormatException: For input string: "85.5"
> at
> java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
> at java.base/java.lang.Integer.parseInt(Integer.java:668)
> at java.base/java.math.BigInteger.(BigInteger.java:536)
> at java.base/java.math.BigInteger.(BigInteger.java:674)
> at
> org.geotools.xs.bindings.XSIntegerBinding.parse(XSIntegerBinding.java:96)
> at org.geotools.xsd.impl.ParseExecutor.visit(ParseExecutor.java:142)
> ... 32 more
>
> *Here is my code sample: *
>
> public class App {
> public static void main(String[] args) throws ServiceException,
> IOException {
>
> System.out.println(GeoTools.getAboutInfo());
>
> URL url = null;
> try {
>   url = new URL("
> https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi;);
> } catch (MalformedURLException e) {
>   // will not happen
> }
> WebMapTileServer wmts = null;
> try {
>   wmts = new WebMapTileServer(url);
> } catch (IOException e) {
>   // There was an error communicating with the server
>   // For example, the server is down
> } catch (ServiceException e) {
>   // The server returned a ServiceException (unusual in this case)
> } catch (SAXException e) {
>   // Unable to parse the response from the server
>   // For example, the capabilities it returned was not valid
> }
>
> System.out.println(wmts.getCapabilities().getService().getName());
>     }
> }
>
> I tried different servers. I get a response to a manual request from all
> of them.
>
> It would be very much appreciated if anyone has a solution or a hint for
> me.
>
> Thanks in advance,
>
> Daniel
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Exception when getFeatures()

2022-11-07 Thread Ian Turton
You are trying to use java 17, GeoTools prefers java 11 currently.

Ian

On Mon, 7 Nov 2022, 11:51 ,  wrote:

> Hi,
>
> I'm trying to do read (import) a Shape file, in the end it is imported to
> my PostreSQL database but I get this exception when trying to use:
>
>
>
> FeatureCollection featSrcCollection
> = featSource.getFeatures();
>
>
>
> and I also tried (with the same result):
>
>
>
> SimpleFeatureCollection featSrcCollection =
> (SimpleFeatureCollection)featSource.getFeatures();
>
>
>
> The exception I get is:
>
> SEVERE: Error attempting to close a mapped byte buffer :
> java.nio.DirectByteBuffer
>
> JVM : 17.0.4.1 Eclipse Adoptium
>
> java.lang.reflect.InaccessibleObjectException: Unable to make public
> jdk.internal.ref.Cleaner java.nio.DirectByteBuffer.cleaner() accessible:
> module java.base does not "opens java.nio" to unnamed module @3e3f6a88
>
> at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
>
> at
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
>
> at
> java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
>
> at
> java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
>
> at
> org.geotools.resources.NIOUtilities.getCleanerMethod(NIOUtilities.java:238)
>
> at
> org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:210)
>
> at
> org.geotools.resources.NIOUtilities$1.run(NIOUtilities.java:206)
>
> at
> java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
>
> at
> org.geotools.resources.NIOUtilities.clean(NIOUtilities.java:205)
>
> at
> org.geotools.resources.NIOUtilities.clean(NIOUtilities.java:184)
>
> at
> org.geotools.data.shapefile.dbf.DbaseFileHeader.readHeader(DbaseFileHeader.java:639)
>
> at
> org.geotools.data.shapefile.dbf.DbaseFileReader.init(DbaseFileReader.java:205)
>
> at
> org.geotools.data.shapefile.dbf.DbaseFileReader.(DbaseFileReader.java:144)
>
> at
> org.geotools.data.shapefile.ShapefileSetManager.openDbfReader(ShapefileSetManager.java:75)
>
> at
> org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:521)
>
> at
> org.geotools.data.shapefile.ShapefileFeatureSource.buildFeatureType(ShapefileFeatureSource.java:479)
>
> at
> org.geotools.data.shapefile.ShapefileFeatureStore.buildFeatureType(ShapefileFeatureStore.java:137)
>
> at
> org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:328)
>
> at
> org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:297)
>
> at
> org.geotools.data.store.ContentFeatureCollection.(ContentFeatureCollection.java:70)
>
> at
> org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:546)
>
> at
> org.geotools.data.store.ContentFeatureSource.getFeatures(ContentFeatureSource.java:106)
>
> at
> org.geotools.jdbcconnection.data.importShape.importShapeFile(importShape.java:381)
>
>
>
> Has anyone solved this problem?
>
> Kind regards,
>
> Paul Malm
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Please clarify exact license

2022-11-03 Thread Ian Turton
On Thu, 3 Nov 2022 at 15:18, Emilian Bold  wrote:

> Hello,
>
> I was browsing GeoTools and I see conflicting evidence about the exact
> license:
>
> 1. https://github.com/geotools/geotools/blob/main/LICENSE.md lists LGPL
> v2.1
> 2. The GitHub README has the http://www.gnu.org/licenses/lgpl.html
> which goes to LGPL v3
> 3. The website https://geotools.org/about.html correctly links to
> https://www.gnu.org/licenses/lgpl-2.1.html
> 4. The pom.xml (https://github.com/geotools/geotools/blob/main/pom.xml#L35
> ), which is part of the binary JARs, mentions
> http://www.gnu.org/copyleft/lesser.txt which again serves LGPL v3.
>

Is this not covered by "any later version" ?

>
> Basically, you need to make sure that all link to gnu.org point
> towards the specific version otherwise GNU will replace the version in
> time and always serve the latest LGPL version...
>
> A PR for Maven, etc. should be easy, just use
> https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
>
>
We're happy to receive pull requests at any time as we are a volunteer
managed project.

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] URL from a FeatureSource

2022-04-07 Thread Ian Turton
I don't think you can - the ShapeFileDatastore doesn't keep that info in a
public variable as far as I can see

Ian


On Thu, 7 Apr 2022 at 11:41,  wrote:

> Hi,
>
> I have a FeatureSource that is a Shape file, How can I read out the URL
> from that FeatureSource to that shape file?
>
> Kind regards,
>
> Paul
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Problems parsing MapServer(?) generated WMS capabilities requests

2022-02-09 Thread Ian Turton
While looking at this question (
https://stackoverflow.com/questions/71040542/request-image-from-wms-to-local-storage-in-java)
I have come across a problem with GeoTools (or xerces) parsing the
GetCapabilties response for what looks like a fairly trivial reason that it
is missing the system id (I think). The funny thing is that all our tests
are still passing and the MapServer we use at work is still working with
this code.

Can any one think of anything that we might have changed recently that
could cause this issue? Or have any ideas on how we can mitigate this?

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] geotools with WFS 2.0.0

2022-01-10 Thread Ian Turton
GeoTools is happy with WFS 2.0.0 but obviously the MapServer strategy
doesn't - that may be an oversight or it might be that MapServer didn't
support 2.0.0 when that code was written. Anyway always happy to receive
code contributions.

Ian

On Mon, 10 Jan 2022 at 09:03, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hi all, Happy New Year,
>
> i'm using geotools version 22.3 and a mapserver wfs.
> I want to process WFS 2.0.0 POST-Requests with that mapserver. (later i
> want to implement paging)
> But it seems like geotools doesn't support WFS 2.0.0 for mapserver.
> As shown in the code, if the url contains anything like "map=" or
> "mapserver" the "org.geotools.data.wfs.internal.v1_x.MapServerWFSStrategy"
> is used (see
> org.geotools.data.wfs.internal.WFSClient.determineCorrectStrategy()). That
> strategy supports only WFS 1.0.0 or 1.1.0.
>
> Does geotools not support WFS 2.0.0?
>
> Thanks
> Benjamin ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] drawing a fan shape

2021-11-07 Thread Ian Turton
I answered a similar question a while ago -
https://gis.stackexchange.com/a/205751/79

Ian

On Sun, 7 Nov 2021 at 14:02, lum_h--- via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> Hi folks!
>
> I'm new to using geotools, and I would like to be able to draw fan shape:
>
> The parameters are:
>
> 1.  Inner radius
>
> 2.  Outer radius
>
> 3.  Anchor position (centre)
>
> 4.  Start sector angle
>
> 5.  End sector angle
>
>
>
> It would seem to be a pologon created by the intersection of 2 arcs and
> two lines from a centre point.
>
>
>
> Appreciate your help!
>
> LumH
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geotools version 25.2 LiteCoordinateSequence

2021-10-07 Thread Ian Turton
if you had clicked the goto home link it would work -
https://osgeo-org.atlassian.net/jira/software/c/projects/GEOT/issues/

Ian

On Thu, 7 Oct 2021 at 08:56, Peter Friess  wrote:

> Well, ...
>
> I have created a test example. Very simple, just used your Quickstart and
> added two statements. I would have uploaded it and created an issue, but
> the link  (https://osgeo-org.atlassian.net/jira/software/c/projects/GEOT)
> you provided is broken.  As I can't upload the example I attached it here.
>
> Peter
> Am 07.10.2021 um 09:40 schrieb Ian Turton:
>
>
>
> On Wed, 6 Oct 2021 at 18:02, Peter Friess  wrote:
>
>> Our application is huge. It is not straightforward to create a test
>> example.  Let me respond to what you stated
>>
>> > This is the problem!!! You should be passing in *3* then the check
>> would pass!
>> How should I pass in 3?. All is done inside StreamingRenderer. It starts
>> with
>> StreamingRenderer.paint
>> StreamingRenderer.processStylers
>> StreamingRenderer.drawPlain
>> StreamingRenderer.processFeature
>> StreamingRenderer.processSymbolizers
>> StreamingRenderer$RenderableFeature.getShape
>> StreamingRenderer$RenderableFeature.getTransformedShape
>> and then it calls
>> LiteCoordinateSequence.cloneGeometry
>> which then does inside this check and throws an exception.
>>
>> Means, I do not pass anything. Inside this sequence it uses the
>> CoordinateReferenceSystem which it gets from SymbolizerAssociation. This
>> CoordinateReferenceSystem returns as dimension 2 which then is used in that
>> check. So, I do not pass a 2. It is all done inside StreamingRenderer. The
>> CoordinateReferenceSystemis is created by CRS.decode(code), again not my
>> code. As it is a UTM projection the dimension is 2.
>>
>> =>  when I create a 2-dimensional point -  new Coordinate(x,y) - all
>> works fine.
>>
>> =>  when I create a 3-dimensional point -  new Coordinate(x,y,z) - and
>> I  do *NOT *load the features into memory;all works fine.
>>
>> =>  when I create a 3-dimensional point -  new Coordinate(x,y,z) - and
>> I  do load the points into memory -  DataUtilities.source(
>> DataUtilities.collection(source.getFeatures())) - then the exception is
>> throw as StreaminReader clones the geometry inside  getTransformedShape.
>>
>> There is a problem when the geometry gets cloned and when the Point is 3D
>> but the CoordinateReferenceSystem is 2D. This did perfectly work in version
>> 21.2. And it does *not *work in 25.2
>>
>> Shouldn't that be enough information  to understand the problem.
>>
>
> It very well might be but certainly I (and I suspect the other developers)
> will not expend the effort in our limited spare time to look into this
> issue if there is no issue raised and if we have to try to figure out a
> test to demonstrate the issue. You might want to watch a couple of useful
> videos that explain how this works - The secret life of open source
> developers (
> https://media.ccc.de/v/bucharest-322-the-secret-life-of-open-source-developers)
> and Earning your support instead of buying it (https://vimeo.com/144089061)
>
>
> Ian
>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geotools version 25.2 LiteCoordinateSequence

2021-10-07 Thread Ian Turton
On Wed, 6 Oct 2021 at 18:02, Peter Friess  wrote:

> Our application is huge. It is not straightforward to create a test
> example.  Let me respond to what you stated
>
> > This is the problem!!! You should be passing in *3* then the check
> would pass!
> How should I pass in 3?. All is done inside StreamingRenderer. It starts
> with
> StreamingRenderer.paint
> StreamingRenderer.processStylers
> StreamingRenderer.drawPlain
> StreamingRenderer.processFeature
> StreamingRenderer.processSymbolizers
> StreamingRenderer$RenderableFeature.getShape
> StreamingRenderer$RenderableFeature.getTransformedShape
> and then it calls
> LiteCoordinateSequence.cloneGeometry
> which then does inside this check and throws an exception.
>
> Means, I do not pass anything. Inside this sequence it uses the
> CoordinateReferenceSystem which it gets from SymbolizerAssociation. This
> CoordinateReferenceSystem returns as dimension 2 which then is used in that
> check. So, I do not pass a 2. It is all done inside StreamingRenderer. The
> CoordinateReferenceSystemis is created by CRS.decode(code), again not my
> code. As it is a UTM projection the dimension is 2.
>
> =>  when I create a 2-dimensional point -  new Coordinate(x,y) - all works
> fine.
>
> =>  when I create a 3-dimensional point -  new Coordinate(x,y,z) - and I
> do *NOT *load the features into memory;all works fine.
>
> =>  when I create a 3-dimensional point -  new Coordinate(x,y,z) - and I
> do load the points into memory -  DataUtilities.source(
> DataUtilities.collection(source.getFeatures())) - then the exception is
> throw as StreaminReader clones the geometry inside  getTransformedShape.
>
> There is a problem when the geometry gets cloned and when the Point is 3D
> but the CoordinateReferenceSystem is 2D. This did perfectly work in version
> 21.2. And it does *not *work in 25.2
>
> Shouldn't that be enough information  to understand the problem.
>

It very well might be but certainly I (and I suspect the other developers)
will not expend the effort in our limited spare time to look into this
issue if there is no issue raised and if we have to try to figure out a
test to demonstrate the issue. You might want to watch a couple of useful
videos that explain how this works - The secret life of open source
developers (
https://media.ccc.de/v/bucharest-322-the-secret-life-of-open-source-developers)
and Earning your support instead of buying it (https://vimeo.com/144089061)

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geotools version 25.2 LiteCoordinateSequence

2021-10-06 Thread Ian Turton
On Wed, 6 Oct 2021 at 17:03, Peter Friess  wrote:

> Sorry Ian,
>
> I don't get it. I create a Coordinate and pass 3 values: 
> enh.getX(),enh.getY(),
> enh.getZ(). Why are you telling me I pass 2? I also stated I check in the
> debugger the Coordinate has x, y, and z.
>

> The problem is that the CRS returns 2 as dimension, which is correct

This is the problem!!! You should be passing in *3* then the check would
pass! At no point did I suggest you passed in two.

Please produce a small test case so we can all see what is happening.

Ian

> Peter
>
>
> Am 06.10.2021 um 17:52 schrieb Ian Turton:
>
>
>
> On Wed, 6 Oct 2021 at 16:35, Peter Friess  wrote:
>
>> Hi Ian
>>
>> My points have a dimension of 3, see below, or let me repeat here:
>>
>> gf.createPoint(new Coordinate(enh.getX(), enh.getY(), enh.getZ()
>>
>> My points have X,Y,Z. The problem is that the CRS returns 2 as dimension,
>> which is correct
>>
>
> No that is the problem - your points have a dimension of 3 so you should
> not pass in 2 here.  You could try calling
> `org.geotools.geometry.jts.LiteCoordinateSequence.guessDimension(Coordinate...)`
> which should return 3 for your data.
>
>> , but  in PackedCoordinateSequence it does this check (dimension -
>> measures < 2) and this measures is 1. measures comes from my Point which
>> contains XYZ (I checked in the debugger) when it gets converted to
>> CoordinateSequence and this CoordinateSequence returns the 1 for the  
>> measures
>> (cs.getMeasures()).
>>
>> I have no clue what that measures means and why it is 1. I also do not
>> understand why it is necessary to involve a CRS to get a dimension if a
>> Point gets (just) cloned.
>>
>
> measures are the M of a POINTMZ or POINTM (so yet another dimension to the
> coordinate) - you should get 3-1 = 2 (x,y) and all should be well.
>
> Yes, it is a show stopper. What I want to try is, use jts-1.11 instead of
>> jts-1.18. Not sure if that is compatible with Geotools 25.2. It is also not
>> clear to me, who is responsible for jts. Is it the Geotools team, or some
>> other team.
>>
>
> It looks like it is a geotools problem, so as a first step raise an issue (
> https://osgeo-org.atlassian.net/jira/software/c/projects/GEOT) preferably
> with a test case. Then either wait for a fix to come, or implement a fix or
> incentivise someone to care about it for you.
>
> Ian
>
> --
> Ian Turton
>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] DataStoreFinder.findDataStore returns null for postgis datastore

2021-09-25 Thread Ian Turton
river:jar:2.44.0:test
> [INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.44.0:test
> [INFO] |  |  +- net.java.dev.jna:jna:jar:3.4.0:test
> [INFO] |  |  \- net.java.dev.jna:platform:jar:3.4.0:test
> [INFO] |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.44.0:test
> [INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.44.0:test
> [INFO] |  \- org.webbitserver:webbit:jar:0.4.14:test
> [INFO] | \- io.netty:netty:jar:3.5.2.Final:test
> [INFO] \- com.opera:operadriver:jar:1.5:test
> [INFO]+- com.opera:operalaunchers:jar:1.1:test
> [INFO]+- com.google.protobuf:protobuf-java:jar:2.4.1:test
> [INFO]+- commons-jxpath:commons-jxpath:jar:1.3:test
> [INFO]+- org.apache.commons:commons-exec:jar:1.1:test
> [INFO]\- org.ini4j:ini4j:jar:0.5.2:test
> [INFO]
> 
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] time zone problem when requesting GeoPackage with timestamp-filter

2021-08-05 Thread Ian Turton
On Thu, 5 Aug 2021 at 09:01, Florian Kaselow <
florian.kase...@data-experts.de> wrote:

> Hello geotools user,
>
> I want to request features from a geopackage. The features In the
> geopackage contain an timestamp attribute which is specified with time zone
> UTC+2 .
> In the filter of my query there is a timestamp specified in also with the
> time zone UTC+2.
> Example of a filter and the resulting where clause (using:
> org.geotools.geopkg.GeoPackage.reader(FeatureEntry, Filter, Transaction)
>  GeoTools Version 22.3):
>
> Filter: [ timeattribute < Fri May 24 13:48:59 CEST 2019 ]
> SQL where: ("timeattribute" < datetime('2019-05-24 13:48:59.0','localtime')
>
> In the SQL will be final the following where clause: "timeattribute" <
> '2019-05-24 1*5*:48:59.0')
>
> Geotools seems to ignore the time zone of the timestamp in the filter
> specification.
> In the GeoPackage, the time is apparently evaluated as UTC and changed
> accordingly by +2 hours and incorrect features are determined from the
> GeoPackage.


It seems as if GeoTools *is* taking the timezone into account and correctly
converting it to UTC - this is why we usually recommend storing times as
UTC in the database . There is a long thread in the archives somewhere from
when I went through all the JDBC code and made sure it was doing the
"right" thing regardless of what timezone the request came from so that
this was not a problem any more. Since the GeoPackage datastore inherits
all of those tests I would expect it to be working correctly.

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Write a "pretty" GEOJSON

2021-07-01 Thread Ian Turton
Not that I know of, we're in the process of deprecating FeatureJSON and
replacing it with GeoJSONDatastore which does have pretty printing.

Ian

On Thu, 1 Jul 2021 at 15:59, Lorenzo Di Giacomo  wrote:

> Hi, i'm using FeatureJSON writer to write a geojson.
> But the resulting File is not in a "pretty" format (A.K.A. is all in the
> first line).
> I couldn't find any parameters to set in order to prettify the output
> file, is there a way?
> Thanks
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Projection transformation from Arc 1960 / UTM zone 36S To WGS84

2021-04-26 Thread Ian Turton
On Mon, 26 Apr 2021 at 02:53, George Budeba  wrote:

> Hi Ian,
>
> Thank you very much for your reply.
>
> In fact, I went through that related documentation like this one
> .
> I understood how to achieve this with other several projections, but I am
> still not so much clear on how to go on with Arc 1960. I wonder If it is
> supported at all and if it is, I would very much appreciate a sample
> demonstration on how to achieve the reprojection from Arc 1960.
>
>
In which case it would have been helpful if you had said as much in your
initial question - so really your question is does GeoTools support your
projection? which probably boils down to is there an EPSG code for it - a
quick google gives https://epsg.io/21036 so your existing code with
EPSG:21036 will owrk fine.

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Projection transformation from Arc 1960 / UTM zone 36S To WGS84

2021-04-25 Thread Ian Turton
https://docs.geotools.org/latest/userguide/library/referencing/faq.html

On Sun, 25 Apr 2021 at 17:59, George Budeba  wrote:

>  Hi There
>
> How can I utilize GeoTools  with Java to achieve  Projection
> transformation from Arc 1960 / UTM zone 36S To WGS84?
> I have some data that needs to be transformed this way.
>
> I would so much appreciate the help with the formula/method to achieve
> this in Java.
>
>
> With Thanks
>
> George.
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] New maintenance releases

2021-04-25 Thread Ian Turton
The team is pleased to announce that the latest round of maintenance
releases have been made:

GeoTools 24.3
<https://geotoolsnews.blogspot.com/2021/04/geotools-243-released.html>
GeoServer 2.18.3
GeoWebCache 1.18.3
<http://geoserver.org/announcements/2021/04/23/geoserver-2.18.3-released.html>

Thanks to Jody Garnet (GeoCat) for helping out with this release.
-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Do you have any GML files with curves in?

2021-03-05 Thread Ian Turton
Thanks, I'll check them out.

Ian

On Fri, 5 Mar 2021, 17:37 Andrea Aime,  wrote:

> Hi Ian,
> curves, if memory serves me correctly, are supported only in GML 3 (maybe
> only 3.2?).
> Anyways the xsd-gml3 module has support for parsing them, and a bunch of
> test files, here:
>
> https://github.com/geotools/geotools/tree/66a2f223cef94de6004b6cc8ab47654fbf174afb/modules/extension/xsd/xsd-gml3/src/test/resources/org/geotools/gml3/v3_2
>
> Cheers
> Andrea
>
>
> On Fri, Mar 5, 2021 at 6:34 PM Ian Turton  wrote:
>
>> I'm looking at adding Curve support to GeoTools wfs-ng module and I need
>> some small test files to make sure that the parser is working properly. So
>> please let me know if you have any *small* GML files with various types
>> of curve in them that you are able to release to the project without any
>> copyright issues.
>>
>> Thanks
>>
>> Ian
>> --
>> Ian Turton
>> ___
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
> --
>
> Regards, Andrea Aime
>
> == 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.*
>
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Do you have any GML files with curves in?

2021-03-05 Thread Ian Turton
I'm looking at adding Curve support to GeoTools wfs-ng module and I need
some small test files to make sure that the parser is working properly. So
please let me know if you have any *small* GML files with various types of
curve in them that you are able to release to the project without any
copyright issues.

Thanks

Ian
-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] How to transform WMSLayer

2021-02-10 Thread Ian Turton
On Wed, 10 Feb 2021 at 15:56, Jonas Schrottenbaum <
jonesang...@googlemail.com> wrote:

> You are right, if i change the CRS with the GUI to EPSG:4326, it works. So
> i thought, what's the difference between doing it there and
> programmatically, where it did not work.
> And i found out that apparently DefaultGeographicCRS.WGS84 is not the same
> as EPSG:4326. And it does not work with DefaultGeographicCRS.WGS84. At
> least there i get an invisible layer.
> But now i changed
> from 
> mapcontent.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);
> to 
> mapcontent.getViewport().setCoordinateReferenceSystem(CRS.decode("EPSG:4326"));
> and now it works perfectly.
> Do you know, why this would make a difference and
> why DefaultGeographicCRS.WGS84 could result in an invisible layer?
>
>
There are two possibilities - 1) axis order, your image might be there but
off screen 2) Andrea has just done some work on master to add a "label" to
the defaultCRS which was causing some issues in odd places in GeoServer.

Ian

> Greeting, Jones
>
> Am Mi., 10. Feb. 2021 um 09:52 Uhr schrieb Ian Turton  >:
>
>>
>>
>> On Tue, 9 Feb 2021 at 18:30, Jonas Schrottenbaum via GeoTools-GT2-Users <
>> geotools-gt2-users@lists.sourceforge.net> wrote:
>>
>>> Hello, how can i transform a WMSLayer, or Layer from a WMS into a
>>> different CRS?
>>> I read how to transform JTS Geometries and how to transform
>>> GridCoverages, but could not find any information on how to do this with
>>> WMSLayers.
>>>
>>>
>> You shouldn't need to do anything to transform the layers, once you
>> change the map/viewport crs the layer will automatically change to the new
>> SRS.  I've just done a quick test and that URL seems to display in all of
>> the supported CRS and a few that are not on that list (3875)
>>
>> Ian
>>
>>
>>> --
>> Ian Turton
>>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] How to transform WMSLayer

2021-02-10 Thread Ian Turton
On Tue, 9 Feb 2021 at 18:30, Jonas Schrottenbaum via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> Hello, how can i transform a WMSLayer, or Layer from a WMS into a
> different CRS?
> I read how to transform JTS Geometries and how to transform GridCoverages,
> but could not find any information on how to do this with WMSLayers.
>
>
You shouldn't need to do anything to transform the layers, once you change
the map/viewport crs the layer will automatically change to the new SRS.
I've just done a quick test and that URL seems to display in all of the
supported CRS and a few that are not on that list (3875)

Ian


> --
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GML invisible

2021-02-06 Thread Ian Turton
Well this is a bit weird but after adding a background map I finally found
what seems to be the problem, it's your axis order. If you add

Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);

at the top of your program it correctly draws your polygon in India.
But since your coordinates are valid the other way round I can't quite
see why it wouldn't draw them before.

Ian


On Fri, 5 Feb 2021 at 17:35, maca delic  wrote:

> Thanks for the response, now i understand what that line does.
> Unfortunately removing it did not change anything. The polyong is still
> invisible. I also imported the same gml file into QGIS and it is working
> fine there.
>
> Best regards
>
> *Gesendet:* Freitag, 05. Februar 2021 um 11:20 Uhr
> *Von:* "Ian Turton" 
> *An:* "maca delic" 
> *Cc:* "geotools-users" 
> *Betreff:* Re: [Geotools-gt2-users] GML invisible
> I haven't tested this but I suspect that setting the else rule
> (`rule.setElseFilter(true);`) is the problem as it means the rule will only
> be executed if the filters of the other rules return false, as you only
> have one rule I'm not at all sure what the renderer would do (stepping
> through with the debugger would be the "easy" way to answer that) for the
> time being I'd just remove that line and see if it fixes it.
>
> Ian
>
> On Thu, 4 Feb 2021 at 19:33, maca delic  wrote:
>
>> I'm trying to parse a GML file and make it visible with GeoTools. It is
>> imported into the MapFrame and the geometry is there, as i get information
>> about the polygon if i click on the mappane with the InfoTool.
>> But it is invisible. Is this a styling problem? Or am i using the wrong
>> aproach in general?
>>
>> Best regards
>>
>> File gmlFile = new File("...mypolygon_px6_gml3.1.1.gml");
>> InputStream gmlInStream = new FileInputStream(gmlFile);
>> GML gml = new GML(Version.GML3);
>> SimpleFeatureCollection featureCollection =
>> gml.decodeFeatureCollection(gmlInStream);
>>
>> final StyleBuilder builder = new StyleBuilder();
>> final PolygonSymbolizer polygonSymbolize =
>> builder.createPolygonSymbolizer(Color.RED, Color.GREEN, 1);
>> final Rule rule = builder.createRule(polygonSymbolize);
>> rule.setElseFilter(true);
>> final Rule rules[] = new Rule[] { rule };
>> final FeatureTypeStyle featureTypeStyle =
>> builder.createFeatureTypeStyle("Feature", rules);
>> final Style style = builder.createStyle();
>> style.setName("style");
>> style.getDescription().setTitle("User Style");
>> style.getDescription().setAbstract("Definition of Style");
>> style.featureTypeStyles().add(featureTypeStyle);
>>
>> FeatureLayer layer = new FeatureLayer(featureCollection, style);
>> MapContent mapcontent = new MapContent();
>> mapcontent.getViewport().setBounds(layer.getBounds());
>> mapcontent.addLayer(layer);
>> JMapFrame.showMap(mapcontent);
>> ___
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
> --
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] WFS "GetFeature" request is sent twice

2021-02-05 Thread Ian Turton
Please try to keep replies on the user list where others can chime in or
learn from your experience.

On Thu, 4 Feb 2021 at 15:44, Joud Kassem  wrote:

> I just noticed that when I get the featureCollection size
> (featureCollection.size()), a getFeature request is sent! It looks like the
> size method is calling somehow the getCountInternal method in the
> WfsFeatureSource which sends a getFeature request on its own.. the question
> is why size() is calling the  getCountInternal? Another question is why
> isEmpty() is not working on the featureCollection? it returns true even
> though the collection is not empty.. third question, is there a way to know
> how many features there are without using size()?
>
>
In general to save on memory featureCollections are more streams than
collections so you need to go back to the source to find out how many of
them there are in the collection, as to isEmpty() - that might be a bug or
the collection may include data, we need to see your minimum viable code
example before we can comment.

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] FeatureCollection isEmpty() is not working!

2021-02-05 Thread Ian Turton
Again we need more context, a minimum code example that shows the problem
is helpful when reporting alleged bugs. Which FeatureCollection are you
referring to? there are many and I know that .isEmpty works for at least
some of them.

Ian

On Thu, 4 Feb 2021 at 16:12, Joud Kassem  wrote:

> Hi all,
>
> Anyone knows why isEmpty() of the featureCollection is not working? It's
> returning true although the collection is not empty!
>
> Thanks,
> Joud
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GML invisible

2021-02-05 Thread Ian Turton
I haven't tested this but I suspect that setting the else rule
(`rule.setElseFilter(true);`) is the problem as it means the rule will only
be executed if the filters of the other rules return false, as you only
have one rule I'm not at all sure what the renderer would do (stepping
through with the debugger would be the "easy" way to answer that) for the
time being I'd just remove that line and see if it fixes it.

Ian

On Thu, 4 Feb 2021 at 19:33, maca delic  wrote:

> I'm trying to parse a GML file and make it visible with GeoTools. It is
> imported into the MapFrame and the geometry is there, as i get information
> about the polygon if i click on the mappane with the InfoTool.
> But it is invisible. Is this a styling problem? Or am i using the wrong
> aproach in general?
>
> Best regards
>
> File gmlFile = new File("...mypolygon_px6_gml3.1.1.gml");
> InputStream gmlInStream = new FileInputStream(gmlFile);
> GML gml = new GML(Version.GML3);
> SimpleFeatureCollection featureCollection =
> gml.decodeFeatureCollection(gmlInStream);
>
> final StyleBuilder builder = new StyleBuilder();
> final PolygonSymbolizer polygonSymbolize =
> builder.createPolygonSymbolizer(Color.RED, Color.GREEN, 1);
> final Rule rule = builder.createRule(polygonSymbolize);
> rule.setElseFilter(true);
> final Rule rules[] = new Rule[] { rule };
> final FeatureTypeStyle featureTypeStyle =
> builder.createFeatureTypeStyle("Feature", rules);
> final Style style = builder.createStyle();
> style.setName("style");
> style.getDescription().setTitle("User Style");
> style.getDescription().setAbstract("Definition of Style");
> style.featureTypeStyles().add(featureTypeStyle);
>
> FeatureLayer layer = new FeatureLayer(featureCollection, style);
> MapContent mapcontent = new MapContent();
> mapcontent.getViewport().setBounds(layer.getBounds());
> mapcontent.addLayer(layer);
> JMapFrame.showMap(mapcontent);
> _______
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] WFS "GetFeature" request is sent twice

2021-02-04 Thread Ian Turton
that kind of depends on what you are doing with it. Possibly, it is getting
the schema using DescribeFeature and then getting the features, what are
the requests being made?

Ian

On Thu, 4 Feb 2021 at 09:32, Joud Kassem  wrote:

> Hello all,
>
> Anyone knows why geotools gt-wfs-ng is sending the GetFeature request
> twice?
>
> Thanks!
> Joud
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Getting GridCoverage from ImageMosaic Wms from Geoserver

2020-12-26 Thread Ian Turton
You need to use a WCS to get the actual data of a layer back. a WMS is only
showing you a picture of the data.

Ian

On Fri, 25 Dec 2020 at 11:20, Rebo Ghecin  wrote:

> Hi all,
>
> I have an ImageMosaic store of elevation files in Geoserver and serve it
> as WMS. I need to do some raster process when the user clicks a point on
> this WMS layer and then create a geotiff file at the end of the process.
> However, I have stuck on the point getting GridCoverage from this service.
> Should I get them from WMS or should I get them from static files? but then
> I would have another problem of processing on multiple files.
>
> Getting GridCoverage from WMS service is looking good for me If I easily
> create GridCoverage from it so I don't need to handle multiple elevation
> raster files while working and I don't know how to handle them. I mean If a
> user clicks a point on the edge of raster I will need another raster file
> and that would be hard to iterate pixel values for me.
>
> So, long story short, can geotools have an ability to get a GridCoverage
> of a small area (like a 5 square meter area) from WMS of ImageMosaic served
> from Geoserver?
>
> Thanks,
> Cagri
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools Java API EOL?

2020-12-16 Thread Ian Turton
GeoAPI died many years ago - it lives on as the gt-opengis module.

Ian

On Wed, 16 Dec 2020 at 14:09, Symphoni Bush - NOAA Affiliate <
symphoni.b...@noaa.gov> wrote:

> Okay, so for GeoTools API (https://sourceforge.net/projects/geoapi/files/)
> would 3.0.1 be the only supported version?
>
> On Wed, Dec 16, 2020 at 3:31 AM Ian Turton  wrote:
>
>>
>>
>> On Tue, 15 Dec 2020 at 19:42, Symphoni Bush - NOAA Affiliate via
>> GeoTools-GT2-Users  wrote:
>>
>>> I am trying to figure out if there are any EOL versions for GeoTools
>>> Java API, and if so, when do these versions become EOL? Thanks.
>>>
>>
>> While we never formally declare EOL on a release as you are free to
>> continue using any release as long as you want, we cease to actively
>> support a version after roughly a year from its first release. There is a
>> complex diagram that explains the process for GeoServer which follows the
>> same cycle at
>> https://docs.geoserver.org/latest/en/developer/policies/community-process.html#release-cycle
>> .
>>
>> Ian
>>
>> --
>> Ian Turton
>>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools Java API EOL?

2020-12-16 Thread Ian Turton
On Tue, 15 Dec 2020 at 19:42, Symphoni Bush - NOAA Affiliate via
GeoTools-GT2-Users  wrote:

> I am trying to figure out if there are any EOL versions for GeoTools Java
> API, and if so, when do these versions become EOL? Thanks.
>

While we never formally declare EOL on a release as you are free to
continue using any release as long as you want, we cease to actively
support a version after roughly a year from its first release. There is a
complex diagram that explains the process for GeoServer which follows the
same cycle at
https://docs.geoserver.org/latest/en/developer/policies/community-process.html#release-cycle
.

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Transforming incoming layers

2020-12-09 Thread Ian Turton
Sorry, I always assume people are using the supported modules unless they
say otherwise. I've no idea what SWT does.

Ian

On Wed, 9 Dec 2020 at 14:38, Jonas Schrottenbaum 
wrote:

> The quickstart is with the swing module, right? I'm using SWT, so maybe
> there is the problem. Thanks for your help so far. Have to look into that.
>
> Am Mi., 9. Dez. 2020 um 15:37 Uhr schrieb Ian Turton :
>
>> I've just experimented with adding the line
>>
>>
>> map.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);
>>
>> at line 53 of the GeoTools quickstart and opening a shapefile in
>> EPSG:27700, the map is displayed in EPSG:4326 when the display is made
>> visible.
>>
>> Ian
>>
>> On Wed, 9 Dec 2020 at 14:19, Jonas Schrottenbaum <
>> jonesang...@googlemail.com> wrote:
>>
>>> So i also tried mapPane.setCrs(CRS.decode("EPSG:4326"))
>>> and 
>>> mapContent.getViewport().setCoordinateReferenceSystem(CRS.decode("EPSG:4326")),
>>> which both change the CRS you get by
>>> calling mapContent.getCoordinateReferenceSystem(), but as soon as the first
>>> layer comes, it overwrites it with it's own (EPSG:23700)
>>>
>>> Am Mi., 9. Dez. 2020 um 14:50 Uhr schrieb Jonas Schrottenbaum <
>>> jonesang...@googlemail.com>:
>>>
>>>> Oh, how do i set the map CRS? I thought it was
>>>> mapPane.setCRS(DefaultGeographicCRS.WGS84) but that had no effect.
>>>>
>>>> Am Mi., 9. Dez. 2020 um 14:43 Uhr schrieb Ian Turton <
>>>> ijtur...@gmail.com>:
>>>>
>>>>> You can set the map CRS to what ever you want, if you don't specify it
>>>>> then it defaults to the first layer's CRS
>>>>>
>>>>> Ian
>>>>>
>>>>> On Wed, 9 Dec 2020 at 13:33, Jonas Schrottenbaum via
>>>>> GeoTools-GT2-Users  wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> is it possible to transform all incoming layers into for example
>>>>>> epsg:4326?
>>>>>> So no matter what the CRS of a WMSLayer, or FeatureLayer is, they can
>>>>>> always be overlaid?
>>>>>>
>>>>>> Default seems to be that the first incoming layer specifies which CRS
>>>>>> is used, and all other layers coming after that are transformed into the
>>>>>> CRS of the first one.
>>>>>>
>>>>>> Best regards
>>>>>> ___
>>>>>> GeoTools-GT2-Users mailing list
>>>>>> GeoTools-GT2-Users@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Ian Turton
>>>>>
>>>>
>>
>> --
>> Ian Turton
>>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Transforming incoming layers

2020-12-09 Thread Ian Turton
I've just experimented with adding the line

map.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);

at line 53 of the GeoTools quickstart and opening a shapefile in
EPSG:27700, the map is displayed in EPSG:4326 when the display is made
visible.

Ian

On Wed, 9 Dec 2020 at 14:19, Jonas Schrottenbaum 
wrote:

> So i also tried mapPane.setCrs(CRS.decode("EPSG:4326"))
> and 
> mapContent.getViewport().setCoordinateReferenceSystem(CRS.decode("EPSG:4326")),
> which both change the CRS you get by
> calling mapContent.getCoordinateReferenceSystem(), but as soon as the first
> layer comes, it overwrites it with it's own (EPSG:23700)
>
> Am Mi., 9. Dez. 2020 um 14:50 Uhr schrieb Jonas Schrottenbaum <
> jonesang...@googlemail.com>:
>
>> Oh, how do i set the map CRS? I thought it was
>> mapPane.setCRS(DefaultGeographicCRS.WGS84) but that had no effect.
>>
>> Am Mi., 9. Dez. 2020 um 14:43 Uhr schrieb Ian Turton > >:
>>
>>> You can set the map CRS to what ever you want, if you don't specify it
>>> then it defaults to the first layer's CRS
>>>
>>> Ian
>>>
>>> On Wed, 9 Dec 2020 at 13:33, Jonas Schrottenbaum via GeoTools-GT2-Users <
>>> geotools-gt2-users@lists.sourceforge.net> wrote:
>>>
>>>> Hello,
>>>>
>>>> is it possible to transform all incoming layers into for example
>>>> epsg:4326?
>>>> So no matter what the CRS of a WMSLayer, or FeatureLayer is, they can
>>>> always be overlaid?
>>>>
>>>> Default seems to be that the first incoming layer specifies which CRS
>>>> is used, and all other layers coming after that are transformed into the
>>>> CRS of the first one.
>>>>
>>>> Best regards
>>>> ___
>>>> GeoTools-GT2-Users mailing list
>>>> GeoTools-GT2-Users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>>
>>>
>>>
>>> --
>>> Ian Turton
>>>
>>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Transforming incoming layers

2020-12-09 Thread Ian Turton
I usually use something
like map.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);

Looking at JCRSPopupMenu shows that they
use mapPane.getMapContent().getViewport().setCoordinateReferenceSystem(newCRS);
which I suspect boils down to the same thing.

Ian



On Wed, 9 Dec 2020 at 13:51, Jonas Schrottenbaum 
wrote:

> Oh, how do i set the map CRS? I thought it was
> mapPane.setCRS(DefaultGeographicCRS.WGS84) but that had no effect.
>
> Am Mi., 9. Dez. 2020 um 14:43 Uhr schrieb Ian Turton :
>
>> You can set the map CRS to what ever you want, if you don't specify it
>> then it defaults to the first layer's CRS
>>
>> Ian
>>
>> On Wed, 9 Dec 2020 at 13:33, Jonas Schrottenbaum via GeoTools-GT2-Users <
>> geotools-gt2-users@lists.sourceforge.net> wrote:
>>
>>> Hello,
>>>
>>> is it possible to transform all incoming layers into for example
>>> epsg:4326?
>>> So no matter what the CRS of a WMSLayer, or FeatureLayer is, they can
>>> always be overlaid?
>>>
>>> Default seems to be that the first incoming layer specifies which CRS is
>>> used, and all other layers coming after that are transformed into the CRS
>>> of the first one.
>>>
>>> Best regards
>>> ___________
>>> GeoTools-GT2-Users mailing list
>>> GeoTools-GT2-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>
>>
>> --
>> Ian Turton
>>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Transforming incoming layers

2020-12-09 Thread Ian Turton
You can set the map CRS to what ever you want, if you don't specify it then
it defaults to the first layer's CRS

Ian

On Wed, 9 Dec 2020 at 13:33, Jonas Schrottenbaum via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> Hello,
>
> is it possible to transform all incoming layers into for example epsg:4326?
> So no matter what the CRS of a WMSLayer, or FeatureLayer is, they can
> always be overlaid?
>
> Default seems to be that the first incoming layer specifies which CRS is
> used, and all other layers coming after that are transformed into the CRS
> of the first one.
>
> Best regards
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geotools POC on next Feature2DStyle model

2020-11-04 Thread Ian Turton
>>>
>>> ___
>>> GeoTools-GT2-Users mailing 
>>> listGeoTools-GT2-Users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>>
>>>
>>> ___
>>> GeoTools-GT2-Users mailing 
>>> listGeoTools-GT2-Users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>> --
>>> Ingénieur de Recherche CNRS - HDR,
>>> Laboratoire Lab-STICC – UMR 6285
>>> Equipe DECIDE
>>> Institut Universitaire de Technologie de Vannes
>>> 8, Rue Montaigne - BP 561 56017 Vannes Cedex
>>> T: +33 2 97 62 64 92
>>> W: https://cv.archives-ouvertes.fr/erwan-bocher
>>> W: http://www.labsticc.fr
>>>
>>> ___
>>> GeoTools-GT2-Users mailing list
>>> GeoTools-GT2-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>
>>
>>
>> --
>>
>> Regards, Andrea Aime
>>
>> == 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.*
>>
>> --
>> Ingénieur de Recherche CNRS - HDR,
>> Laboratoire Lab-STICC – UMR 6285
>> Equipe DECIDE
>> Institut Universitaire de Technologie de Vannes
>> 8, Rue Montaigne - BP 561 56017 Vannes Cedex
>> T: +33 2 97 62 64 92
>> W: https://cv.archives-ouvertes.fr/erwan-bocher
>> W: http://www.labsticc.fr
>>
>>
>
> --
>
> Regards, Andrea Aime
>
> == 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.*
>
> --
> Ingénieur de Recherche CNRS - HDR,
> Laboratoire Lab-STICC – UMR 6285
> Equipe DECIDE
> Institut Universitaire de Technologie de Vannes
> 8, Rue Montaigne - BP 561 56017 Vannes Cedex
> T: +33 2 97 62 64 92
> W: https://cv.archives-ouvertes.fr/erwan-bocher
> W: http://www.labsticc.fr
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] [GEOT-6722] GeoPackage Double type attributes lose precision

2020-10-16 Thread Ian Turton
It looks like that has been there since the beginning of the module, if you
added a Float.class -> Real as well as Double.class -> Double would that
work? Also are we still able to read back existing geopackages?
Anyway feel free to add a PR with some additional tests.

Ian

On Thu, 15 Oct 2020 at 23:57, Piotr Marcińczyk  wrote:

> Hi all,
>
> I created this ticket:
> https://osgeo-org.atlassian.net/browse/GEOT-6722
> and I'd like to find a solution for this problem.
> However, I'm not sure why the mapping Double -> REAL was created in the
> first place. I was thinking about simply changing the mapping into Double
> -> DOUBLE.
> The tests are passing but I'm not sure about the consequences of such
> change.
>
> Any hints would be appreciated.
>
> Best regards,
>   Piotr Marcińczyk
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools 22.3 generates non-confrom requests according to WFS 1.1.0 specification

2020-08-28 Thread Ian Turton
That does look like it shouldn't be there - can you add a small example
code to show the issue and open a bug on the tracker.

Ian

On Fri, 28 Aug 2020 at 14:46, Florian Kaselow <
florian.kase...@data-experts.de> wrote:

> Hello GeoTools users,
>
> we are using geotools in Version 22.3 and have the following problem:
>
> The WFS requests with geometric filter operation are not correctly
> generated according to WFS 1.1.0 specification (
> *http://schemas.opengis.net/wfs/1.1.0/wfs.xsd*
> <http://schemas.opengis.net/wfs/1.1.0/wfs.xsd>). There is no problem with
> the response to the request, but when validating the request against the
> .xsd file of the WFS specification, the following part of the request is
> identified as invalid (text marked red). The whole filter request is
> additionally inserted into GML3EncodingUtils by a toString() call.
>
> http://geobasis-bb.de/invekos/referenzflaechen; xmlns:xs="
> http://www.w3.org/2001/XMLSchema; xmlns:wfs="http://www.opengis.net/wfs;
> xmlns:gml="http://www.opengis.net/gml; xmlns:ogc="
> http://www.opengis.net/ogc; xmlns:ows="http://www.opengis.net/ows;
> xmlns:xlink="http://www.w3.org/1999/xlink; handle="GeoTools
> 22.3(3ff15461b9dde4ede7e4992fe8c3fb82c492bada) WFS 1.1.0 DataStore
> @ws20180914#2" outputFormat="text/xml; subtype=gml/3.1.1"
> resultType="results" service="WFS" version="1.1.0">
> 
> 
> 
> [ GEOMETRIE intersects MULTIPOLYGON (((461497.4
> 5797427.34, 461474.02 5797438.02, 461392.72 5797473.1, 461362.14
> 5797486.36, 461330.9 5797499.9, 461317.2 5797505.72, 461271.84 5797524.32,
> 461260.5 5797535.12, 461253.42 5797535.12, 461232.14 5797541.56, 461170.16
> 5797568.3, 461067.54 5797611.56,
> ...
> 321282.1962616 5891298.811769), (321351.2090939 5891319.1600721, 321350.08
> 5891292.25, 321350.28091 5891292.2427382, 321351.2090939 5891319.1600721)),
> ((321374.4778471 5891287.1002397, 322055.2260891 5891266.7508291,
> 322055.226089 5891266.750829, 322046.86 5891245.98, 322007.382896
> 5891250.4221765, 321990.62 5891253, 321903 5891264.64, 321899.16 5891262.6,
> 321888.9 5891218.64, 321374.4778471 5891287.1002397))) ]
> GEOMETRIE
> 
> 
> 
> 
> ...
> 
> 
> ...
> 
> 
> 
> 
> 
> 
> ...
> 
> 
> 
> 
> 
> ...
> 
> 
> 
> 
>
> The validation was done with the following online validator:
> https://www.freeformatter.com/xml-validator-xsd.html
>
> Is this request really not compliant to the WFS 1.1.0 specification and
> GeoTools generates incorrect requests?
> If this is a bug, it should be fixed in GeoTools.
>
> Best Regards
> Florian
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Precision of geometries in WFS-Request

2020-08-19 Thread Ian Turton
On Wed, 19 Aug 2020 at 07:17, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hi Ian,
>
> thanks for your reponse.
> We are using a metric coordinate system, so it's definitly some sort of
> noise.
> Unfortunatly we don't have control about the precision of the geometries,
> it is customer related.
> But because of this reduced precison the geometry gets sometimes invalid.
>
> What exactly do you mean "is in control of the server"?
> We are generating the request in our own software with the help of
> geotools and in this request (GML) the geometry differs in precision from
> the geometry we putting into the filter (for example
> org.opengis.filter.spatial.Intersects).
>
>
The GeoTools client makes the request to the server which decides how to
format the GML - there is nothing the client can do to control how many
decimal places are in the GML, so the GML you receive is the same
regardless of how the request is made - try using the URL in a browser or
via curl on the command line, the result will be the same.

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Precision of geometries in WFS-Request

2020-08-18 Thread Ian Turton
I don't think you can, the format of the GML being sent is in the control
of the server. For example GeoServer has an option that sets the number of
decimals (I use 3 by default),

You do know that 7dp is +/- 11mm and is probably random noise - see
https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude
 and https://xkcd.com/2170/ for more discussion.

Ian

On Tue, 18 Aug 2020 at 14:09, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hi,
>
> we are using geotools in Version 22.3.
> Everytime we are building a WFS-Request the precision of the requested
> geometry gets reduced to 6 decimal places. The original geometry has 7
> decimal places.
> How can we configure the request in geotools to get 7 decimal places?
>
> Best regards,
> Benjamin ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] 22.5 Release artifacts available for testing

2020-08-18 Thread Ian Turton
That does seem to be the issue - the text is a lot bolder when using java
11.

[image: expected.png]
[image: actual.png]
I'm happy to let it go if it only occurs on my machine and not travis or
jenkins.

Ian

PS for future reference you also need -Djava.awt.headless=false to make the
interactive tests work through maven.

On Tue, 18 Aug 2020 at 13:19, Andrea Aime 
wrote:

> Hi Ian,
> I've seen something similar in the PR checks, with the latest Java 11...
> think they have changed something
> in font handling, but haven't had time to verify.
>
> The variable you mentioned works from the IDE, from Maven I see this
> variable in the pom:
> false
>
> and then in surefire:
> -Xmx${test.maxHeapSize} ${jvm.opts} -Dfile.encoding=UTF-8
> -Dorg.geotools.test.extensive=${extensive.tests}
> -Dorg.geotools.test.interactive=${interactive.tests}
> -Dorg.geotools.image.test.skip=${skip.image.tests}
> *-Dorg.geotools.image.test.interactive=${interactive.image}*
> -Djava.awt.headless=${java.awt.headless} -Dsun.java2d.d3d=${sun.java2d.d3d}
> -Djava.io.tmpdir="${java.io.tmpdir}"
> -Djava.library.path="${java.library.path}" ${test.args}
>  -XX:+TieredCompilation -XX:TieredStopAtLevel=1
> -XX:+IgnoreUnrecognizedVMOptions
> -Djava.util.logging.config.file="${geotoolsBaseDir}"/${logging-profile}.properties
> --illegal-access=debug
>
> That's what seems to trigger it.
>
> Cheers
> Andrea
>
> On Tue, Aug 18, 2020 at 1:04 PM Ian Turton  wrote:
>
>> I'm seeing a local
>> failure at LabelDisplacementModeTest.testMultiLineLabelDisplacementY - with
>> a difference of 2083 against a threshold of 2000. - just
>> adding -Dorg.geotools.image.test.interactive=true doesn't seem to be enough
>> to enable a visual test any longer, so I'm a bit stuck. Is anyone expecting
>> a font change or anything?
>>
>> Ian
>>
>> On Tue, 18 Aug 2020 at 10:16, Ian Turton  wrote:
>>
>>>
>>> https://build.geoserver.org/view/release/job/geotools-release/15/artifact/
>>>
>>> Ian
>>>
>>> --
>>> Ian Turton
>>>
>>
>>
>> --
>> Ian Turton
>> ___
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
> --
>
> Regards, Andrea Aime
>
> == 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.*
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] 22.5 Release artifacts available for testing

2020-08-18 Thread Ian Turton
I'm seeing a local
failure at LabelDisplacementModeTest.testMultiLineLabelDisplacementY - with
a difference of 2083 against a threshold of 2000. - just
adding -Dorg.geotools.image.test.interactive=true doesn't seem to be enough
to enable a visual test any longer, so I'm a bit stuck. Is anyone expecting
a font change or anything?

Ian

On Tue, 18 Aug 2020 at 10:16, Ian Turton  wrote:

> https://build.geoserver.org/view/release/job/geotools-release/15/artifact/
>
> Ian
>
> --
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] 22.5 Release artifacts available for testing

2020-08-18 Thread Ian Turton
https://build.geoserver.org/view/release/job/geotools-release/15/artifact/

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Problems with AXIS order in CRS

2020-04-28 Thread Ian Turton
It sounds like the data is not actually in EPSG:4326 LAT/LON order then,
thus the renderer is getting confused by the fact that the CRS claims to be
a NORTH_EAST projection when the data isn't. In general avoid using
EPSG:4326 unless you are very sure that is what you have and you are sure
about the axis order (usually, to the extent of checking the axis order
while writing the coordinates into the geometries). You never know what the
user may have set the hints to until you get there.

Ian

On Tue, 28 Apr 2020 at 14:35, David Adler  wrote:

> A DB2 sample program that displays a map based on spatial data in a DB2
> table used to work but no longer works when I tried it recently. It just
> fails to display anything.
>
> It seems to be related to the AXIS ordering in the CRS which is different
> depending on whether one uses CRS.decode("EPSG:4326) or CRS.parseWKT(wkt)
> where wkt is the string representation of EPSG 4326. I fixed the problem by
> changing the DB2 code to use CRS.parseWKT instead of  CRS.decode with "org"
> and "orgid". Shouldn't it work both ways?
>
> The following is my analysis of the problem:
>
> Using CRS.decode("EPSG:4326")
> results in
> GEOGCS["WGS 84",
>   DATUM["World Geodetic System 1984",
> SPHEROID["WGS 84", 6378137.0, 298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
>   PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
>   UNIT["degree", 0.017453292519943295],
>   AXIS["Geodetic latitude", NORTH],
>   AXIS["Geodetic longitude", EAST],
>   AUTHORITY["EPSG","4326"]]
>
> In StreamingRenderer.paint
> CRS.getAxisOrder(mapCRS) returns CRS.AxisOrder.NORTH_EAST
> which executes the following code which flips the AffineTransform in
> WorldToScreen which completely messes up the subsequent transformation
> from world to screen coordinates, causing them to be outside the
> clip area.
> if (CRS.getAxisOrder(mapCRS) == CRS.AxisOrder.NORTH_EAST) {
> try {
> // sanitize, having flipped axis causes slowdowns, the
> rendering
> // subsystem has to go from data to rendering to screen
> flipping axis order
> // twice when advanced projection handling is enabled
> Integer code = CRS.lookupEpsgCode(mapCRS, false);
> if (code != null) {
> String srs = "EPSG:" + code;
> CoordinateReferenceSystem earthNorthCRS =
> CRS.decode(srs, true);
> mapArea =
> new ReferencedEnvelope(
> mapArea.getMinY(),
> mapArea.getMaxY(),
> mapArea.getMinX(),
> mapArea.getMaxX(),
> earthNorthCRS);
> }
>
> // flip world to screen too
> worldToScreen =
> new AffineTransform(
> worldToScreen.getShearX(),
> worldToScreen.getScaleX(),
> worldToScreen.getScaleY(),
> worldToScreen.getShearY(),
> worldToScreen.getTranslateX(),
> worldToScreen.getTranslateY());
> } catch (Exception e) {
> LOGGER.log(
> Level.FINER,
> "Failed to turn the requested bbox in east/north
> order, map rendering "
> + "should work anyways, but pay a
> performance price");
> }
>
> Creating the CRS from WKT, everything works fine.
> CRS from CRS.decodeWKT(wkt)
> GEOGCS["GCS_WGS_1984",
>   DATUM["D_WGS_1984",
> SPHEROID["WGS_1984", 6378137.0, 298.257223563]],
>   PRIMEM["Greenwich", 0.0],
>   UNIT["degree", 0.017453292519943295],
>   AXIS["Longitude", EAST],
>   AXIS["Latitude", NORTH]]
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Problems with the unsupported SWT module

2020-04-22 Thread Ian Turton
tly overlay
> multiple different layers like shapefile and WMS?
> And should i follow the developers guide when trying to update the swt
> module and talk to the dev mailing list and get the contributers license
> and so on?
>
> Best regards
> Jones
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Create Single Band GeoTiff

2020-04-17 Thread Ian Turton
can you show us the code you are using?

Ian

On Fri, 17 Apr 2020 at 02:15, John Paul via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> Support-
>
> I am trying to merge multiple ArcGrid files into a single Geotiff file.
> When using the BandMergeProcess, each grid coverage is a separate band and
> only the first band has the color grey assigned.
>
> How can a single grey scaled band geotiff be created from multiple ArcGrid
> files?
>
> Thanks-
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-08 Thread Ian Turton
uot;ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3] ⇨
ProjectedCRS[ETRS89 / UTM zone 32N (zE-N)]",
  SOURCE["DHDN / 3-degree Gauss-Kruger zone 3", AUTHORITY["EPSG","31467"]],
  TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
  CylindricalProjection["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3]
⇨ GeographicCRS[DHDN]",
SOURCE["DHDN / 3-degree Gauss-Kruger zone 3",
AUTHORITY["EPSG","31467"]],
TARGET["DHDN", AUTHORITY["EPSG","4314"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]]],
  Transformation["DHDN to ETRS89 (3)",
SOURCE["DHDN", AUTHORITY["EPSG","4314"]],
TARGET["ETRS89", AUTHORITY["EPSG","4258"]],
METHOD["Position Vector transformation (geog2D domain)",
AUTHORITY["EPSG","9606"]],
AUTHORITY["EPSG","1778"]],
  CylindricalProjection["UTM zone 32N with prefix",
SOURCE["ETRS89", AUTHORITY["EPSG","4258"]],
TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
AUTHORITY["EPSG","4648"]]]
ConcatenatedOperation["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3] ⇨
ProjectedCRS[ETRS89 / UTM zone 32N (zE-N)]",
  SOURCE["DHDN / 3-degree Gauss-Kruger zone 3", AUTHORITY["EPSG","31467"]],
  TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
  CylindricalProjection["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3]
⇨ GeographicCRS[DHDN]",
SOURCE["DHDN / 3-degree Gauss-Kruger zone 3",
AUTHORITY["EPSG","31467"]],
TARGET["DHDN", AUTHORITY["EPSG","4314"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]]],
  Transformation["DHDN to ETRS89 (7)",
SOURCE["DHDN", AUTHORITY["EPSG","4314"]],
TARGET["ETRS89", AUTHORITY["EPSG","4258"]],
METHOD["Position Vector transformation (geog2D domain)",
AUTHORITY["EPSG","9606"]],
AUTHORITY["EPSG","1782"]],
  CylindricalProjection["UTM zone 32N with prefix",
SOURCE["ETRS89", AUTHORITY["EPSG","4258"]],
TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
AUTHORITY["EPSG","4648"]]]
ConcatenatedOperation["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3] ⇨
ProjectedCRS[ETRS89 / UTM zone 32N (zE-N)]",
  SOURCE["DHDN / 3-degree Gauss-Kruger zone 3", AUTHORITY["EPSG","31467"]],
  TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
  CylindricalProjection["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3]
⇨ GeographicCRS[DHDN]",
SOURCE["DHDN / 3-degree Gauss-Kruger zone 3",
AUTHORITY["EPSG","31467"]],
TARGET["DHDN", AUTHORITY["EPSG","4314"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]]],
  Transformation["DHDN to ETRS89 (1)",
SOURCE["DHDN", AUTHORITY["EPSG","4314"]],
TARGET["ETRS89", AUTHORITY["EPSG","4258"]],
METHOD["Coordinate Frame rotation (geog2D domain)",
AUTHORITY["EPSG","9607"]],
AUTHORITY["EPSG","1309"]],
  CylindricalProjection["UTM zone 32N with prefix",
SOURCE["ETRS89", AUTHORITY["EPSG","4258"]],
TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
AUTHORITY["EPSG","4648"]]]
ConcatenatedOperation["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3] ⇨
ProjectedCRS[ETRS89 / UTM zone 32N (zE-N)]",
  SOURCE["DHDN / 3-degree Gauss-Kruger zone 3", AUTHORITY["EPSG","31467"]],
  TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
  CylindricalProjection["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3]
⇨ GeographicCRS[DHDN]",
SOURCE["DHDN / 3-degree Gauss-Kruger zone 3",
AUTHORITY["EPSG","31467"]],
TARGET["DHDN", AUTHORITY["EPSG","4314"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]]],
  Transformation["DHDN to ETRS89 (6)",
SOURCE["DHDN", AUTHORITY["EPSG","4314"]],
TARGET["ETRS89", AUTHORITY["EPSG","4258"]],
METHOD["Position Vector transformation (geog2D domain)",
AUTHORITY["EPSG","9606"]],
AUTHORITY["EPSG","1781"]],
  CylindricalProjection["UTM zone 32N with prefix",
SOURCE["ETRS89", AUTHORITY["EPSG","4258"]],
TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
AUTHORITY["EPSG","4648"]]]
ConcatenatedOperation["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3] ⇨
ProjectedCRS[ETRS89 / UTM zone 32N (zE-N)]",
  SOURCE["DHDN / 3-degree Gauss-Kruger zone 3", AUTHORITY["EPSG","31467"]],
  TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
  CylindricalProjection["ProjectedCRS[DHDN / 3-degree Gauss-Kruger zone 3]
⇨ GeographicCRS[DHDN]",
SOURCE["DHDN / 3-degree Gauss-Kruger zone 3",
AUTHORITY["EPSG","31467"]],
TARGET["DHDN", AUTHORITY["EPSG","4314"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]]],
  Transformation["DHDN to ETRS89 (8)",
SOURCE["DHDN", AUTHORITY["EPSG","4314"]],
TARGET["ETRS89", AUTHORITY["EPSG","4258"]],
METHOD["NTv2", AUTHORITY["EPSG","9615"]],
AUTHORITY["EPSG","15948"]],
  CylindricalProjection["UTM zone 32N with prefix",
SOURCE["ETRS89", AUTHORITY["EPSG","4258"]],
TARGET["ETRS89 / UTM zone 32N (zE-N)", AUTHORITY["EPSG","4647"]],
METHOD["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
AUTHORITY["EPSG","4648"]]]

On Wed, 8 Apr 2020 at 14:01, Ian Turton  wrote:

>
>
> On Wed, 8 Apr 2020 at 13:57, Benjamin Sokolowski <
> benjamin.sokolow...@data-experts.de> wrote:
>
>> >> Are you sure this transform is in the EPSG tables?
>> Probably not. The grid was calculated specifically for the state of
>> Schleswig Holstein in Germany. In my head it is like this: I register a
>> user-defined transformation in geotools of 31467 to 4647. This is always
>> done taking into account the grid I provide (the specific gsb file). Am I
>> wrong?
>>
>
> Where are you registering that?
>
> Ian
>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-08 Thread Ian Turton
On Wed, 8 Apr 2020 at 13:57, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> >> Are you sure this transform is in the EPSG tables?
> Probably not. The grid was calculated specifically for the state of
> Schleswig Holstein in Germany. In my head it is like this: I register a
> user-defined transformation in geotools of 31467 to 4647. This is always
> done taking into account the grid I provide (the specific gsb file). Am I
> wrong?
>

Where are you registering that?

Ian
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-08 Thread Ian Turton
A bit more digging

NTv2GridShiftFactory fac = new NTv2GridShiftFactory();
URL url = fac.getClass().getResource("shtransntv2.gsb");
System.out.println(fac.isNTv2Grid(url));
GridShiftFile grid = fac.createNTv2Grid(url);
System.out.println(grid);

gives

Headers  : 11
Sub Hdrs : 11
Sub Grids: 1
Type : SECONDS
Version  : NTv2.0
Fr Ellpsd: DHDN90
To Ellpsd: ETRS89
Fr Maj Ax: 6377397.155
Fr Min Ax: 6356078.963
To Maj Ax: 6378137.0
To Min Ax: 6356752.314

so it looks like that transform will only be used between DHDN geoids (
http://epsg.io/4314-15949) and ETRS89 - so it might work with DHDN /
3-degree Gauss-Kruger zone 3 (E-N) (http://epsg.io/5677)

Ian

On Wed, 8 Apr 2020 at 13:32, Ian Turton  wrote:

> On further investigation at epgs.io I can get a gsb transform for
> epsg:31467->epsg:4326 (WGS84) using BETA2007.gsb but not the epsg:4258
> (ETRS) which is the base for EPSG:4647 (ETRS89 / UTM zone 32N (zE-N)).
>
> I can't find any reference to the need for a grid file for this transform
> so that may be why it isn't picked up by the code? Are you sure this
> transform is in the EPSG tables?
>
> Ian
>
> On Wed, 8 Apr 2020 at 05:55, Benjamin Sokolowski <
> benjamin.sokolow...@data-experts.de> wrote:
>
>> With and without gsb file the same output:
>>
>> CONCAT_MT[INVERSE_MT[PARAM_MT["Transverse_Mercator",
>>   PARAMETER["semi_major", 6377397.155],
>>   PARAMETER["semi_minor", 6356078.962818189],
>>   PARAMETER["central_meridian", 9.0],
>>   PARAMETER["latitude_of_origin", 0.0],
>>   PARAMETER["scale_factor", 1.0],
>>   PARAMETER["false_easting", 350.0],
>>   PARAMETER["false_northing", 0.0]]],
>>   PARAM_MT["Ellipsoid_To_Geocentric",
>> PARAMETER["dim", 2],
>> PARAMETER["semi_major", 6377397.155],
>> PARAMETER["semi_minor", 6356078.962818189]],
>>   PARAM_MT["Affine",
>> PARAMETER["num_row", 4],
>> PARAMETER["num_col", 4],
>> PARAMETER["elt_0_0", 1.0255],
>> PARAMETER["elt_0_1", 0.1356027323924231],
>> PARAMETER["elt_0_2", 0.0027634450290912],
>> PARAMETER["elt_0_3", 612.4],
>> PARAMETER["elt_1_0", -0.1356027323924231],
>> PARAMETER["elt_1_1", 1.0255],
>> PARAMETER["elt_1_2", 0.0026180005538759],
>> PARAMETER["elt_1_3", 77.0],
>> PARAMETER["elt_2_0", -0.0027634450290912],
>> PARAMETER["elt_2_1", -0.0026180005538759],
>> PARAMETER["elt_2_2", 1.0255],
>> PARAMETER["elt_2_3", 440.2]],
>>   PARAM_MT["Geocentric_To_Ellipsoid",
>> PARAMETER["dim", 2],
>> PARAMETER["semi_major", 6378137.0],
>> PARAMETER["semi_minor", 6356752.314140356]],
>>   PARAM_MT["Transverse_Mercator",
>> PARAMETER["semi_major", 6378137.0],
>> PARAMETER["semi_minor", 6356752.314140356],
>> PARAMETER["central_meridian", 9.0],
>> PARAMETER["latitude_of_origin", 0.0],
>> PARAMETER["scale_factor", 0.9996],
>> PARAMETER["false_easting", 3250.0],
>> PARAMETER["false_northing", 0.0]]]
>>
>> which i think, is the default transformation of geotools. Here's the gsb
>> file
>>
>>
>> Benjamin
>>
>>
>>
>> Von:"Ian Turton" 
>> An:"Benjamin Sokolowski" 
>> Kopie:"geotools-users" 
>> Datum:07.04.2020 15:53
>> Betreff:Re: Re: Re: [Geotools-gt2-users] Coordinate
>> Transformation
>> --
>>
>>
>>
>> Can you try this program with and without the GSB file
>>
>> import org.geotools.referencing.CRS;
>> import org.opengis.referencing.FactoryException;
>> import org.opengis.referencing.NoSuchAuthorityCodeException;
>> import org.opengis.referencing.crs.CoordinateReferenceSystem;
>> import org.opengis.referencing.operation.MathTransform;
>>
>> public class gridShiftTest {
>>
>>   public static void main(String[] args) throws
>> NoSuchAuthorityCodeException, FactoryException {
>>
>> CoordinateReferenceSystem sourceCRS = CRS.decode( "EPSG:31467" );
>> CoordinateReferenceSystem targetCRS = CRS.decode( "EPSG:4647" );
>> MathTransform transform = CRS.find

Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-08 Thread Ian Turton
On further investigation at epgs.io I can get a gsb transform for
epsg:31467->epsg:4326 (WGS84) using BETA2007.gsb but not the epsg:4258
(ETRS) which is the base for EPSG:4647 (ETRS89 / UTM zone 32N (zE-N)).

I can't find any reference to the need for a grid file for this transform
so that may be why it isn't picked up by the code? Are you sure this
transform is in the EPSG tables?

Ian

On Wed, 8 Apr 2020 at 05:55, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> With and without gsb file the same output:
>
> CONCAT_MT[INVERSE_MT[PARAM_MT["Transverse_Mercator",
>   PARAMETER["semi_major", 6377397.155],
>   PARAMETER["semi_minor", 6356078.962818189],
>   PARAMETER["central_meridian", 9.0],
>   PARAMETER["latitude_of_origin", 0.0],
>   PARAMETER["scale_factor", 1.0],
>   PARAMETER["false_easting", 350.0],
>   PARAMETER["false_northing", 0.0]]],
>   PARAM_MT["Ellipsoid_To_Geocentric",
> PARAMETER["dim", 2],
> PARAMETER["semi_major", 6377397.155],
> PARAMETER["semi_minor", 6356078.962818189]],
>   PARAM_MT["Affine",
> PARAMETER["num_row", 4],
> PARAMETER["num_col", 4],
> PARAMETER["elt_0_0", 1.0255],
> PARAMETER["elt_0_1", 0.1356027323924231],
> PARAMETER["elt_0_2", 0.0027634450290912],
> PARAMETER["elt_0_3", 612.4],
> PARAMETER["elt_1_0", -0.1356027323924231],
> PARAMETER["elt_1_1", 1.0255],
> PARAMETER["elt_1_2", 0.0026180005538759],
> PARAMETER["elt_1_3", 77.0],
> PARAMETER["elt_2_0", -0.0027634450290912],
> PARAMETER["elt_2_1", -0.0026180005538759],
> PARAMETER["elt_2_2", 1.0255],
> PARAMETER["elt_2_3", 440.2]],
>   PARAM_MT["Geocentric_To_Ellipsoid",
> PARAMETER["dim", 2],
> PARAMETER["semi_major", 6378137.0],
> PARAMETER["semi_minor", 6356752.314140356]],
>   PARAM_MT["Transverse_Mercator",
> PARAMETER["semi_major", 6378137.0],
> PARAMETER["semi_minor", 6356752.314140356],
> PARAMETER["central_meridian", 9.0],
> PARAMETER["latitude_of_origin", 0.0],
> PARAMETER["scale_factor", 0.9996],
> PARAMETER["false_easting", 3250.0],
> PARAMETER["false_northing", 0.0]]]
>
> which i think, is the default transformation of geotools. Here's the gsb
> file
>
>
> Benjamin
>
>
>
> Von:"Ian Turton" 
> An:"Benjamin Sokolowski" 
> Kopie:"geotools-users" 
> Datum:07.04.2020 15:53
> Betreff:Re: Re: Re: [Geotools-gt2-users] Coordinate Transformation
> --
>
>
>
> Can you try this program with and without the GSB file
>
> import org.geotools.referencing.CRS;
> import org.opengis.referencing.FactoryException;
> import org.opengis.referencing.NoSuchAuthorityCodeException;
> import org.opengis.referencing.crs.CoordinateReferenceSystem;
> import org.opengis.referencing.operation.MathTransform;
>
> public class gridShiftTest {
>
>   public static void main(String[] args) throws
> NoSuchAuthorityCodeException, FactoryException {
>
> CoordinateReferenceSystem sourceCRS = CRS.decode( "EPSG:31467" );
> CoordinateReferenceSystem targetCRS = CRS.decode( "EPSG:4647" );
> MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);
>
> System.out.println(transform);
>   }
>
> }
>
> Or mail me the gsb file if you can and I'll try - I don't seem to have a
> grid file for this transformation on my system because I've mainly used UK
> and USA ones in the past.
>
> Ian
>
> On Tue, 7 Apr 2020 at 13:21, Benjamin Sokolowski <
> *benjamin.sokolow...@data-experts.de*
> > wrote:
> Hi Ian,
>
> even with the .gsb in the new folder with your given name, no changes at
> all. Same wrong results. Do you have another idea what i'm missing? The
> "epsg_operations.properties" is not mandatory right? I don't have that
> right now.
>
> Benjamin
>
>
>
> Von:"Ian Turton" <*ijtur...@gmail.com* >
> An:"Benjamin Sokolowski" <*benjamin.sokolow...@data-experts.de*
> >
> Kopie:"geotools-users" <*geotools-gt2-users@lists.sourceforge.net*
> >
> Datum:07.04.2020 11:33
> Betreff:Re: Re: [Geotools-gt2-users] Coo

Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-07 Thread Ian Turton
Can you try this program with and without the GSB file

import org.geotools.referencing.CRS;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;

public class gridShiftTest {

  public static void main(String[] args) throws
NoSuchAuthorityCodeException, FactoryException {

CoordinateReferenceSystem sourceCRS = CRS.decode( "EPSG:31467" );
CoordinateReferenceSystem targetCRS = CRS.decode( "EPSG:4647" );
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS);

System.out.println(transform);
  }

}

Or mail me the gsb file if you can and I'll try - I don't seem to have a
grid file for this transformation on my system because I've mainly used UK
and USA ones in the past.

Ian

On Tue, 7 Apr 2020 at 13:21, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hi Ian,
>
> even with the .gsb in the new folder with your given name, no changes at
> all. Same wrong results. Do you have another idea what i'm missing? The
> "epsg_operations.properties" is not mandatory right? I don't have that
> right now.
>
> Benjamin
>
>
>
> Von:"Ian Turton" 
> An:"Benjamin Sokolowski" 
> Kopie:"geotools-users" 
> Datum:07.04.2020 11:33
> Betreff:Re: Re: [Geotools-gt2-users] Coordinate Transformation
> --
>
>
>
> I've never tried adding a gsb file directly to the jar file, I usually
> create the folder 
> src/main/resources/org/geotools/referencing/factory/gridshift
> in my project and store the file in there.
>
> Ian
>
> On Tue, 7 Apr 2020 at 10:14, Benjamin Sokolowski <
> *benjamin.sokolow...@data-experts.de*
> > wrote:
> Hi Ian,
>
> thanks for the reply. Found the discussion at stackexchange already, but
> it didn't help me. Maybe i didn't understand it correctly.
> >> *where exactly did you put it?*
> Do you mean in which jar-File?   gt-referencing-16.0.jar
> I only have geotools in the build path, not the sources.
>
> Benjamin
>
>
>
> Von:"Ian Turton" <*ijtur...@gmail.com* >
> An:"Benjamin Sokolowski" <*benjamin.sokolow...@data-experts.de*
> >
> Kopie:"geotools-users" <*geotools-gt2-users@lists.sourceforge.net*
> >
> Datum:07.04.2020 11:06
> Betreff:Re: [Geotools-gt2-users] Coordinate Transformation
> --
>
>
>
> Have a look at
> *https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523*
> <https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523>
>  for
> an example.
>
> When you say you added the .gsb to 
> 'org.geotools.referencing.factory.gridshift'
> where exactly did you put it?
>
> Ian
>
> On Tue, 7 Apr 2020 at 09:33, Benjamin Sokolowski <
> *benjamin.sokolow...@data-experts.de*
> > wrote:
> Hello,
>
> first time posting. Hope you guys can help.
> I want to transform coordinates (point geometry) from Gauß Krueger Zone 3
> to ETRS:89 UTM32 using geotools and a grid file, which i already have. How
> exactly do i do this?
>
> I already got the codelines:
> CoordinateReferenceSystem sourceCRS = CRS.*decode*( "EPSG:31467" );
> CoordinateReferenceSystem targetCRS = CRS.*decode*( "EPSG:4647" );
> MathTransform transformation = CRS.*findMathTransform*( sourceCRS,
> targetCRS );
> Geometry result = JTS.*transform*( geometry, transformation );
>
> and put the .gsb to 'org.geotools.referencing.factory.gridshift', but that
> doesn't seem to work. Geotools is still using the default Transformation,
> not the more precise with the grid file.
>
> Best regards
> Benjamin Sokolowski___
> GeoTools-GT2-Users mailing list
> *GeoTools-GT2-Users@lists.sourceforge.net*
> 
> *https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users*
> <https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users>
>
>
> --
> Ian Turton
>
>
>
> --
> Ian Turton
>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-07 Thread Ian Turton
I've never tried adding a gsb file directly to the jar file, I usually
create the folder src/main/resources/org/geotools/referencing/factory/gridshift
in my project and store the file in there.

Ian

On Tue, 7 Apr 2020 at 10:14, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hi Ian,
>
> thanks for the reply. Found the discussion at stackexchange already, but
> it didn't help me. Maybe i didn't understand it correctly.
> >> *where exactly did you put it?*
> Do you mean in which jar-File?   gt-referencing-16.0.jar
> I only have geotools in the build path, not the sources.
>
> Benjamin
>
>
>
> Von:"Ian Turton" 
> An:"Benjamin Sokolowski" 
> Kopie:"geotools-users" 
> Datum:07.04.2020 11:06
> Betreff:Re: [Geotools-gt2-users] Coordinate Transformation
> --
>
>
>
> Have a look at
> *https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523*
> <https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523>
>  for
> an example.
>
> When you say you added the .gsb to 
> 'org.geotools.referencing.factory.gridshift'
> where exactly did you put it?
>
> Ian
>
> On Tue, 7 Apr 2020 at 09:33, Benjamin Sokolowski <
> *benjamin.sokolow...@data-experts.de*
> > wrote:
> Hello,
>
> first time posting. Hope you guys can help.
> I want to transform coordinates (point geometry) from Gauß Krueger Zone 3
> to ETRS:89 UTM32 using geotools and a grid file, which i already have. How
> exactly do i do this?
>
> I already got the codelines:
> CoordinateReferenceSystem sourceCRS = CRS.*decode*( "EPSG:31467" );
> CoordinateReferenceSystem targetCRS = CRS.*decode*( "EPSG:4647" );
> MathTransform transformation = CRS.*findMathTransform*( sourceCRS,
> targetCRS );
> Geometry result = JTS.*transform*( geometry, transformation );
>
> and put the .gsb to 'org.geotools.referencing.factory.gridshift', but that
> doesn't seem to work. Geotools is still using the default Transformation,
> not the more precise with the grid file.
>
> Best regards
> Benjamin Sokolowski___________
> GeoTools-GT2-Users mailing list
> *GeoTools-GT2-Users@lists.sourceforge.net*
> 
> *https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users*
> <https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users>
>
>
> --
> Ian Turton
>
>

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Coordinate Transformation

2020-04-07 Thread Ian Turton
Have a look at
https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523
for
an example.

When you say you added the .gsb to 'org.geotools.referencing.factory.gridshift'
where exactly did you put it?

Ian

On Tue, 7 Apr 2020 at 09:33, Benjamin Sokolowski <
benjamin.sokolow...@data-experts.de> wrote:

> Hello,
>
> first time posting. Hope you guys can help.
> I want to transform coordinates (point geometry) from Gauß Krueger Zone 3
> to ETRS:89 UTM32 using geotools and a grid file, which i already have. How
> exactly do i do this?
>
> I already got the codelines:
> CoordinateReferenceSystem sourceCRS = CRS.*decode*( "EPSG:31467" );
> CoordinateReferenceSystem targetCRS = CRS.*decode*( "EPSG:4647" );
> MathTransform transformation = CRS.*findMathTransform*( sourceCRS,
> targetCRS );
> Geometry result = JTS.*transform*( geometry, transformation );
>
> and put the .gsb to 'org.geotools.referencing.factory.gridshift', but that
> doesn't seem to work. Geotools is still using the default Transformation,
> not the more precise with the grid file.
>
> Best regards
> Benjamin Sokolowski___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Final releases of GeoTools 21.5, GeoWebCache 1.15.5 & GeoServer 2.15.5

2020-02-24 Thread Ian Turton
The final planned releases of GeoTools 21.5, GeoWebCache 1.15.5 & GeoServer
2.15.5 have been made. If you or your organisation is still using any of
these versions you need to seriously consider upgrading to a later version
now.

Blog posts describing the changes are at
https://geotoolsnews.blogspot.com/2020/02/geotools-215-released.html &
http://blog.geoserver.org/2020/02/24/geoserver-2-15-5-released/

The PMC are grateful to Astun Technology and GeoSolutions IT for Ian Turton
& Andrea Aime's time respectively to make this release.
-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Calculate points on an arc

2020-02-04 Thread Ian Turton
It depends on the version of GeoTools you are using - prior to 20.x you
need a com.vividsolutions one after that an org.locationtech one. See
https://docs.geotools.org/stable/userguide/welcome/upgrade.html for more
information.

Ian

On Tue, 4 Feb 2020 at 06:35,  wrote:

> Just a one more question, please.
>
> What type of Point is centre, start and end,
> com.vividsolutions.jts.geom.point or org.locationtech.jts.geom.Point*.*
>
> Sorry but I know too little about the different libraries.
>
>
>
> *Från:* Ian Turton [mailto:ijtur...@gmail.com]
> *Skickat:* den 3 februari 2020 12:14
> *Till:* Malm, Paul (Operations AIM)
> *Kopia:* geotools-users
> *Ämne:* Re: [Geotools-gt2-users] Calculate points on an arc
>
>
>
> You can use the org.geotools.referencing.GeodeticCalculator to do this,
> something like:
>
>
>
> private void createPolygon(Point centre, Point start, Point end) {
> ArrayList coords = new ArrayList<>();
> coords.add(start.getCoordinate());
> CALC.setStartingGeographicPoint(centre.getX(), centre.getY());
> CALC.setDestinationGeographicPoint(start.getX(), start.getY());
> double bearing1 = CALC.getAzimuth();
> double radius = CALC.getOrthodromicDistance();
> CALC.setDestinationGeographicPoint(end.getX(), end.getY());
> double bearing2 = CALC.getAzimuth();
>
> double angle = bearing2 - bearing1;
> int nSteps = 10;
> double dStep = angle / nSteps;
> coords.add(start.getCoordinate());
> for (int i = 0; i < nSteps; i++) {
>   CALC.setDirection((bearing1 + (i * dStep)), radius);
>   Point2D p = CALC.getDestinationGeographicPoint();
>   coords.add(new Coordinate(p.getX(), p.getY()));
> }
> coords.add(end.getCoordinate());
> LineString line = GF.createLineString(coords.toArray(new Coordinate[]
> {}));
> WKTWriter writer = new WKTWriter();
> System.out.println(writer.write(centre));
> System.out.println(writer.write(start));
> System.out.println(writer.write(end));
> System.out.println(writer.write(line));
>   }
>
>
>
> Where CALC is a GeodeticCalculator and GF is a GeometryFactory will give
> you:
>
>
>
> [image: arc.png]
>
>
>
> Ian
>
>
>
> On Mon, 3 Feb 2020 at 09:21,  wrote:
>
> Hi list,
>
> I would like to draw a circle arc in WGS84 coordinates
>
> I have an arc start point (lat/lon in WGS84),
>
> an arc end point (lat/lon in WGS84),
>
> an arc center point (lat/lon in WGS84),
>
> a bearing from the center point to the start point
>
> the arc radius in meter.
>
> Now I would like to calculate several points (WGS84 lat/lon) on the arc.
>
> Is there a way to do it with Geotools, if so how?
>
>
>
> I appreciate your help,
>
> Paul
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
>
> --
>
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Calculate points on an arc

2020-02-03 Thread Ian Turton
You can use the org.geotools.referencing.GeodeticCalculator to do this,
something like:

private void createPolygon(Point centre, Point start, Point end) {
ArrayList coords = new ArrayList<>();
coords.add(start.getCoordinate());
CALC.setStartingGeographicPoint(centre.getX(), centre.getY());
CALC.setDestinationGeographicPoint(start.getX(), start.getY());
double bearing1 = CALC.getAzimuth();
double radius = CALC.getOrthodromicDistance();
CALC.setDestinationGeographicPoint(end.getX(), end.getY());
double bearing2 = CALC.getAzimuth();

double angle = bearing2 - bearing1;
int nSteps = 10;
double dStep = angle / nSteps;
coords.add(start.getCoordinate());
for (int i = 0; i < nSteps; i++) {
  CALC.setDirection((bearing1 + (i * dStep)), radius);
  Point2D p = CALC.getDestinationGeographicPoint();
  coords.add(new Coordinate(p.getX(), p.getY()));
}
coords.add(end.getCoordinate());
LineString line = GF.createLineString(coords.toArray(new Coordinate[]
{}));
WKTWriter writer = new WKTWriter();
System.out.println(writer.write(centre));
System.out.println(writer.write(start));
System.out.println(writer.write(end));
System.out.println(writer.write(line));
  }

Where CALC is a GeodeticCalculator and GF is a GeometryFactory will give
you:

[image: arc.png]

Ian

On Mon, 3 Feb 2020 at 09:21,  wrote:

> Hi list,
>
> I would like to draw a circle arc in WGS84 coordinates
>
> I have an arc start point (lat/lon in WGS84),
>
> an arc end point (lat/lon in WGS84),
>
> an arc center point (lat/lon in WGS84),
>
> a bearing from the center point to the start point
>
> the arc radius in meter.
>
> Now I would like to calculate several points (WGS84 lat/lon) on the arc.
>
> Is there a way to do it with Geotools, if so how?
>
>
>
> I appreciate your help,
>
> Paul
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Update to the User documentation

2019-09-11 Thread Ian Turton
I have completed the marathon spell check fix of the user documentation for
GeoTools today. If you spot anything that looks wrong please let me know
via the issue tracker. This involved changes to 280 files to fix 7000+
spelling issues (many of these were class names etc with no formatting) so
I may not have seen everything that has changed and so can't rule out the
odd issue.

In future I will be forcing a spelling check into the  documentation build
process (though I need to update the build server software first). I have
updated the documentation build instructions at
https://docs.geotools.org/latest/userguide/build/install/sphinx.html to
show how to add spell checks. You need to add extensions = ['sphinx.ext.todo
','sphinx.ext.extlinks', 'sphinxcontrib.spelling'] to docs/common.py to
force it to run.

Cheers

Ian
-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools 21.2 and Java 12

2019-08-10 Thread Ian Turton
Shapefile.initialize(BN_Shapefile.java:333)
>
> at
> utilities.shapeFiles.BN_Shapefile.(BN_Shapefile.java:289)
>
>     at
> module.GeoImageLoader.GeoImageLoader$1.run(GeoImageLoader.java:760)
>
> at java.base/java.lang.Thread.run(Thread.java:835)
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Unable to work with Arabic encoding

2019-08-05 Thread Ian Turton
Does this help?
https://stackoverflow.com/questions/56902605/why-do-i-code-error-geotools-create-shapefile-chinese-setattribute-error


Ian

On Mon, 5 Aug 2019 at 15:59, andrea antonello 
wrote:

> Hi all,
> I am in the need of writing a shapefile containing Arabic characters.
> I followed the directions found in the guide:
> http://docs.geotools.org/stable/userguide/library/data/shape.html
> and set the "charset" parameter in the map that is used to create the
> datastore.
>
> Checking in memory and printing to console the featurecollection's
> attributes shows me that everything works fine right until before doing the
> writing transaction.
>
> Then, if I try to open the file with a GIS or libreoffice or even read it
> with geotools, the content is completely wrong, since the attributes names
> where also Arabic and not only the names are scrambled but also the values
> where not filled in (some of which just numbers). So I get empty bad
> looking stuff.
>
> Any idea on what I might be still missing?
> Thanks for any help,
> Cheers,
> Andrea
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] New maintenance releases 20.5, 1.14.5, 2.14.5

2019-07-26 Thread Ian Turton
We are pleased to announce the release of GeoTools 20.5, GeoWebCache 1.14.5
and GeoServer 2.14.5 as the probable final releases in the current
maintenance series of these projects. If you are still using any of them
you should start planning for the move to the GeoTools 21.x, GeoWebCache
1.15.x and GeoServer 2.15.x series as there is unlikely to be further
volunteer led work on these versions of the software.

We are grateful to the support of Astun Technology in the making of this
release.

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] shape prj file

2019-07-10 Thread Ian Turton
You can use something like (from
https://docs.geotools.org/stable/userguide/library/referencing/crs.html#matching-a-coordinatereferencesystem
):

CoordinateReferenceSystem crs = CRS.decode("EPSG:32735");
Formattable f = (Formattable) CRS.decode("EPSG:32735", true);
String wkt = f.toWKT(Citations.ESRI, 2); // use 0 indent for single line

System.out.println("wkt for EPSG:32735 (ESRI)");
System.out.println(wkt);


To produce a more ESRI friendly WKT in your .prj file. I thought there was
a flag you could pass to the ShapefileWriter to set that up but I can't see
it on a quick look.

Alternatively, you could open a bug report with ESRI asking them to support
the standard better.

Ian

On Wed, 10 Jul 2019 at 10:38,  wrote:

> Hi,
>
> when I export a Postgis table to a shape file and the try to import it
> into Arc Gis, I will always have to reproject the file from eg Wgs84(4326)
> to Wgs84(4326) at the import stage. It seems that Arc Gis  don’t understand
> that the prj file describes the wgs84 projection, but funny enough ArcGis
> understands it when it should project the file! ArcGis prj file is not the
> same as my prj file, but the result of the description in the prj files is
> the same.
>
> The result when importing the wgs84 shape file is still correct when it is
> imported and projected to wgs84.
>
>
>
> It is really annoying to have to reproject to the same projection when
> importing to ArcGis.
>
> Is there anyone who has an solution for this?
>
> I’m using the following example code:
>
> *private* *void* exportLayer(String layerName, File directory) *throws*
> IOException {
>
> SimpleFeatureSource featureSource = MainDialog.*getDataStore*
> ().getFeatureSource(layerName);
>
> SimpleFeatureType ft = featureSource.getSchema();
>
> String fileName = ft.getTypeName();
>
> File file = *new* File(directory, fileName + ".shp");
>
> Map creationParams = *new*
> HashMap<>();
>
> creationParams.put("url", URLs.*fileToUrl*(file));
>
> FileDataStoreFactorySpi factory = FileDataStoreFinder.
> *getDataStoreFactory*("shp");
>
> DataStore dataStore = factory.createNewDataStore(
> creationParams);
>
> dataStore.createSchema(ft);
>
> // The following workaround to write out the *prj* is no
> longer needed
>
> //
> ((ShapefileDataStore)dataStore).forceSchemaCRS(ft.getCoordinateReferenceSystem());
>
>
>
> SimpleFeatureStore featureStore = (SimpleFeatureStore)
> dataStore.getFeatureSource(layerName);
>
>
>
> Transaction t = *new* DefaultTransaction();
>
> *try* {
>
>  SimpleFeatureCollection collection =
> featureSource.getFeatures(); // grab all features
>
>  featureStore.addFeatures(collection);
>
>  t.commit(); // write it out
>
> } *catch* (IOException eek) {
>
>  JOptionPane.*showMessageDialog*(*null*, eek
> .toString());
>
>  eek.printStackTrace();
>
>  *try* {
>
>  t.rollback();
>
>  } *catch* (IOException doubleEeek) {
>
>  // *rollback* failed?
>
>  }
>
> } *finally* {
>
>          t.close();
>
> }
>
> MainDialog.*removeDataStore*();
>
> }
>
>
>
>
>
> Kind regars,
>
> Paul
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] correlation

2019-07-10 Thread Ian Turton
That is a separate project from Mango Systems (http://www.mangosystem.com/)
so you would need to ask them directly if there is a translation of the
manual.

Alternatively, you could look at Comparing Raster Map Comparison Algorithms
<https://www.ingentaconnect.com/contentone/asprs/pers/2005/0071/0008/art8?crawler=true>
 for Spatial Modeling and Analysis
<https://www.ingentaconnect.com/contentone/asprs/pers/2005/0071/0008/art8?crawler=true>
for
a insight into how to implement your own correlation process.

Ian

On Wed, 10 Jul 2019 at 09:52, Anna Amat  wrote:

>
> Hello,
>
> I would like to create a geotiff with the correlation between to
> single-band rasters.
> I have found gt-process-spatialstatistics.jar. Does anyone knows if there
> is a tutorial or manual on gt-process-spatialstatistics.jar in english?
>
> Or in alternative, can anyone suggest me another way to visualize the
> spatial correlation between rasters?
>
> Thanks,
> Anna
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] trying to learn geotools

2019-06-04 Thread Ian Turton
can you add a screen shot of what is shown? I'm confused as to what you are
seeing, also it may help if you can point us to the shapefile you are using.

Ian

On Tue, 4 Jun 2019 at 10:02,  wrote:

> Hi,
>
> It is mirrored, I tried to set the system property and it seems ok. Is
> there any danger of doing this since the system property sets in the main
> method of the application? I’m doing a lot of data manipulation in the
> application and one function is viewing  the data afterwards.
>
> Kind regards,
>
> Paul
>
> *Från:* Jody Garnett [mailto:jody.garn...@gmail.com]
> *Skickat:* den 4 juni 2019 02:05
> *Till:* Andrea Aime
> *Kopia:* Malm, Paul (Operations AIM); geotools-gt2-users
> *Ämne:* Re: [Geotools-gt2-users] trying to learn geotools
>
>
>
> Paul is the shape file mirrored or rotated 90 degrees?
>
>
>
> Andrea if you think it will reduce confusion we can the following to the
> tutorials:
>
>
>
>System.setProperty("org.geotools.referencing.forceXY", "true");
>
> --
>
> Jody Garnett
>
>
>
>
>
> On Sat, 1 Jun 2019 at 01:49, Andrea Aime 
> wrote:
>
> Hi Jody,
>
> I believe it's the normal behavior unless one forces lon/lat order via
> hints/system variables?
>
> I was always weirded out that our demos do not set them by default.
>
>
>
> Another possible approach is to hunt down all data sources defaulting to
> east/north order
>
> and force the axis order while decoding the CRSs (will take some time and
> require writing
>
> a bunch of new tests of course).
>
>
>
> Cheers
>
> Andrea
>
>
>
>
>
> On Sat, Jun 1, 2019 at 8:34 AM Jody Garnett 
> wrote:
>
> What does the PRJ file for your shapefile say? That behaviour sounds very
> odd.
>
>
>
> On Fri, May 31, 2019 at 11:16  wrote:
>
> Hi,
>
> I’m rather new at GeoTools, an trying to learn it.
>
> I’ve loaded downloaded the map style tutorial example (
> http://docs.geotools.org/latest/userguide/tutorial/map/style.html).
>
> When I load my shape-file (a simple world counties shape-file in WGS84) it
> is drawn mirrored, and when I zoom in counties disappears. The shape-file
> works well in Qgis, ArcInfo etc…
>
> When I use the select tool it finds countries mirrored from where I pick,
> it seems that the select tool is correct and finds the correct county
> (where it should be in a wgs84 word map), but the country is drawn in the
> diagonal quarter and is mirrored.
>
> Any ideas?
>
> Thanks,
>
> Paul
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
> --
>
> --
>
> Jody Garnett
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
>
> --
>
> Regards, Andrea Aime == 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.*
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] Odd slow down in Image Ops for non square gridcoverages

2019-04-16 Thread Ian Turton
While answering this question <https://gis.stackexchange.com/q/318813/79> on
gis.stackexchange, I ran into an odd result. I'm not sure if it is a bug or
not.

If you are using `Operations.add` to sum a series of gridcoverages and all
the images are square (h==w) then for 10 grids of 4000x4000 it takes about
5 seconds which is fine, if you make h=4001 the time jumps to 8000 seconds.
While if you are using Jiffle the time stays the same at about 10 seconds
for each size.

Is this expected? or should I file a bug?

Cheers

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Runtime error in web application environment

2019-04-02 Thread Ian Turton
How did you package your war file?

Ian

On Tue, 2 Apr 2019, 09:33 Peter,  wrote:

> Dear all,
>
> Eclipse+Maven+Tomcat.
>
> My code runs fine when run as "Java Application".
>
> It fails when running within a servlet. So it must be an issue with the
> Jar Loader of geotools.
>
>
> using org.geotools.metadata.iso.citation.Citations
>
>
> throws
>
>
> java.lang.AbstractMethodError:
>
>
> org.geotools.metadata.iso.citation.ContactImpl.getOnlineResource()Lorg/opengis/metadata/citation/OnlineResource;
>
>
> The error is thrown in the static part of Citations
>
>   final CitationImpl c = new CitationImpl(ResponsiblePartyImpl.OGC);
>
> Has anyone any idea? Maybe a geotools Hint ?
>
> I spent already hours without a solution.
>
> Thank you
>
> Peter
>
>
> java.lang.AbstractMethodError:
>
> org.geotools.metadata.iso.citation.ContactImpl.getOnlineResource()Lorg/opengis/metadata/citation/OnlineResource;
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498) at
> org.geotools.metadata.PropertyAccessor.get(PropertyAccessor.java:450) at
> org.geotools.metadata.PropertyAccessor.hashCode(PropertyAccessor.java:773)
> at
> org.geotools.metadata.MetadataStandard.hashCode(MetadataStandard.java:303)
> at
> org.geotools.metadata.AbstractMetadata.hashCode(AbstractMetadata.java:198)
> at
> org.geotools.metadata.PropertyAccessor.hashCode(PropertyAccessor.java:775)
> at
> org.geotools.metadata.MetadataStandard.hashCode(MetadataStandard.java:303)
> at
> org.geotools.metadata.AbstractMetadata.hashCode(AbstractMetadata.java:198)
> at java.util.HashMap.hash(HashMap.java:339) at
> java.util.HashMap.put(HashMap.java:612) at
> java.util.HashSet.add(HashSet.java:220) at
> org.geotools.util.CheckedHashSet.add(CheckedHashSet.java:190) at
> org.geotools.metadata.iso.citation.CitationImpl.(CitationImpl.java:156)
> at org.geotools.metadata.iso.citation.Citations.(Citations.java:76)
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] generailisation

2019-03-20 Thread Ian Turton
I think this might depend on how you set up your output datastore, or what
sort it is - I've attached my code which I've been using on Shapefiles with
no issues (on master)

Ian

On Tue, 19 Mar 2019 at 13:50,  wrote:

> Hi Ian,
>
> This is how I use the generalizer:
>
> *while* (fit.hasNext()) {
>
>SimpleFeature inFeature = fit.next();
>
>MultiPolygon polygon = (MultiPolygon) inFeature.getDefaultGeometry();
>
> *  if* (polygon!= *null* && polygon.isSimple()) {
>
>   Coordinate[] coords = polygon.getCoordinates();
>
>   System.*out*.println("ant coords before = " + coords.length);
>
>   // Genarelize all polygons with more then 5 points
>
> *  if* (coords.length > 5) {
>
>  DouglasPeuckerSimplifier simplifier = *new*
> DouglasPeuckerSimplifier(polygon);
>
>  simplifier.setDistanceTolerance(10);
>
>  simplifier.setEnsureValid(*false*);
>
>  Geometry out =  simplifier.getResultGeometry();
>
>  coords = out.getCoordinates();
>
>  System.*out*.println("ant coords after = " + coords.length);
>
>  }
>
>  // make all coordinates (x,y,0)
>
>  Coordinate[] coords2 = *new* Coordinate[coords.length];
>
> * for*(*int* i = 0; i < coords.length; i++){
>
> Coordinate c = *new* Coordinate(coords[i].x, coords[i].y, 0);
>
> coords2[i] = c;
>
>  }
>
>  // Do your thing here with the coordinates, but first make sure that
> you create lines correct.
>
>  // Just make the polygon to a line string
>
>  // coords2 = CreateCenterLineFromCooordinates(coords2);
>
>  LineString line = gFactory.createLineString(coords2);
>
>  SimpleFeature feature = writer.next();
>
>  List l = inFeature.getAttributes();
>
> * for* (*int* i = 1; i < l.size(); i++) {
>
> // copy all attributes but the first geometry
>
> feature.setAttribute(i, l.get(i));
>
>  }
>
>  feature.setDefaultGeometry(line);
>
>  writer.write();
>
>   }
>
> }
>
> writer.close();
>
> tx.commit();
>
> tx.close();
>
> fit.close();
>
> }
>
>
>
> I can see that the coordinates from the generalizer seems correct
> (x,y,n/a) in the debugger.
>
> I have tried to change the coordinates, so that all has (x,y,0), even
> those polygons who are not generalized.
>
> Then I create a line instead of a polygon.
>
> When I look in PostGis the objects that are generalized has no geometry =
> null, but not the others. It must be something that I’m doing wrong or is
> it something I miss?
>
> I have pointed out GeooTools 20.2 in my pom file.
>
>
>
> Kind regards,
>
> Paul
>
>
>
> *Från:* Ian Turton [mailto:ijtur...@gmail.com]
> *Skickat:* den 15 mars 2019 18:15
> *Till:* Malm, Paul (Operations AIM)
> *Kopia:* geotools-users
> *Ämne:* Re: [Geotools-gt2-users] generailisation
>
>
>
> How are you getting the coordinates out? Most output formats will ignore Z
> if it is not set.
>
>
>
> Ian
>
>
>
> On Fri, 15 Mar 2019 at 15:08,  wrote:
>
> Hi Ian!
>
> Thanks, it worked. But there is one problem.
>
> The unchanged objects has (x,y) coordinates and I’m getting (x,y,n/a)
> coordinates for the changed object.
>
> ArcGis does not seem to be able to have this(x,y,z) coordinates or mixed
> coordinate types. The changed objects
>
> has the correct values of x,y but does not show in ArcGis.
>
> Does anyone have any suggestions?
>
> Kind regards,
>
> Paul
>
>
>
> *Från:* Ian Turton [mailto:ijtur...@gmail.com]
> *Skickat:* den 15 mars 2019 09:49
> *Till:* Malm, Paul (Operations AIM)
> *Kopia:* geotools-users
> *Ämne:* Re: [Geotools-gt2-users] generailisation
>
>
>
> You should be able to use a DouglasPeuckerSimplifier to achieve this.
> Something like:
>
>
>
> DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(in);
>
> simplifier.setDistanceTolerance(tolerance);
>
> Geometry out =  simplifier.getResultGeometry();
>
>
>
> would do it.
>
>
>
> JTS also provides a TopologyPresersevingSimplifier and a
> LineSegmentSimplifier that would also handle your case.
>
>
>
> Ian
>
>
>
> On Fri, 15 Mar 2019 at 06:32,  wrote:
>
> Hi,
>
> I wonder if there is a generalize function using angles.
>
> I have polygons almost like a rectangle/romb. 90 percent has only five
> vertices, but some have more. The extra vertices is om the sides (the
> straight lines).
>
> I would like to remove those vertices and thought th

Re: [Geotools-gt2-users] generailisation

2019-03-15 Thread Ian Turton
How are you getting the coordinates out? Most output formats will ignore Z
if it is not set.

Ian

On Fri, 15 Mar 2019 at 15:08,  wrote:

> Hi Ian!
>
> Thanks, it worked. But there is one problem.
>
> The unchanged objects has (x,y) coordinates and I’m getting (x,y,n/a)
> coordinates for the changed object.
>
> ArcGis does not seem to be able to have this(x,y,z) coordinates or mixed
> coordinate types. The changed objects
>
> has the correct values of x,y but does not show in ArcGis.
>
> Does anyone have any suggestions?
>
> Kind regards,
>
> Paul
>
>
>
> *Från:* Ian Turton [mailto:ijtur...@gmail.com]
> *Skickat:* den 15 mars 2019 09:49
> *Till:* Malm, Paul (Operations AIM)
> *Kopia:* geotools-users
> *Ämne:* Re: [Geotools-gt2-users] generailisation
>
>
>
> You should be able to use a DouglasPeuckerSimplifier to achieve this.
> Something like:
>
>
>
> DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(in);
>
> simplifier.setDistanceTolerance(tolerance);
>
> Geometry out =  simplifier.getResultGeometry();
>
>
>
> would do it.
>
>
>
> JTS also provides a TopologyPresersevingSimplifier and a
> LineSegmentSimplifier that would also handle your case.
>
>
>
> Ian
>
>
>
> On Fri, 15 Mar 2019 at 06:32,  wrote:
>
> Hi,
>
> I wonder if there is a generalize function using angles.
>
> I have polygons almost like a rectangle/romb. 90 percent has only five
> vertices, but some have more. The extra vertices is om the sides (the
> straight lines).
>
> I would like to remove those vertices and thought that there perhaps is a
> method using a max angle to find the extra vertices.
>
> Kind regards,
>
> Paul
>
> ___________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
>
> --
>
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] generailisation

2019-03-15 Thread Ian Turton
You should be able to use a DouglasPeuckerSimplifier to achieve this.
Something like:

DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(in);
simplifier.setDistanceTolerance(tolerance);
Geometry out =  simplifier.getResultGeometry();

would do it.

JTS also provides a TopologyPresersevingSimplifier and a
LineSegmentSimplifier that would also handle your case.

Ian

On Fri, 15 Mar 2019 at 06:32,  wrote:

> Hi,
>
> I wonder if there is a generalize function using angles.
>
> I have polygons almost like a rectangle/romb. 90 percent has only five
> vertices, but some have more. The extra vertices is om the sides (the
> straight lines).
>
> I would like to remove those vertices and thought that there perhaps is a
> method using a max angle to find the extra vertices.
>
> Kind regards,
>
> Paul
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] algorithm for area calculation

2019-03-04 Thread Ian Turton
On Mon, 4 Mar 2019 at 10:11, Yaniv Ben-Yosef  wrote:

> Hi Florian,
>
> This seems to be a good resource for this:
>
>
> https://blog.ianturton.com/geotools,/projections/2017/08/01/area-of-a-polygon.html
>

Actually that's more about how to use the area function.

For the actual algorithm used the best place to look is the code (
https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/algorithm/Area.java)
which suggests that it is based on the Shoelace formula (
http://en.wikipedia.org/wiki/Shoelace_formula).

Ian

>
> Hope this helps,
> Yaniv
>
> On Mon, Mar 4, 2019 at 11:00 AM Florian Micklich 
> wrote:
>
>> Hi everyone,
>>
>> it is more a  jts question, but does anyone know what kind of
>> algorithmus and method is used for calculating the area with getArea()?
>> So far I couldn't find any documentation about this.
>>
>> Is there a different beweteen jts geometries and opengis?
>>
>>
>> Thanks
>>
>>
>>
>> ___
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
> --
> Best regards,
>
> *Yaniv Ben-Yosef*
> *CTO, Milan InnoVincY B.V.*
>
> *M* +972(54)670 9743 | *S* yaniv.benyosef | *E* ybyo...@m-innovincy.com
> 
> *The Netherlands* | Kapteynstraat 1 | 2201BB NOORDWIJK
> *Rwanda* | *AgriLift Ltd* | KG 536 Axiom Building, behind Telecom House |
> KIGALI
>
>
> *Confidential - Do not duplicate or distribute without written permission
> from Milan Innovincy B.V© Milan Innovincy B.V, 2017. Any third party right
> are hereby acknowledged. All rights reserved. Please consider the
> environment – do you really need to print this email?*
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] SQL Server JNDI

2019-02-07 Thread Ian Turton
I'm hitting some issues connecting to an SQL server using JNDI, I'm seeing
exceptions related to invalid table names and it seems unable to get the
native CRS. Before I embark on a length debugging session has any one else
seen this? Is there an easy fix?

Cheers

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] GeoTools 21-RC released

2019-01-28 Thread Ian Turton
This is your final chance to test out the upcoming 21.0 release which
includes Java 11 support, please use it wisely. Read all about the new
features, improvements and bug fixes available in this release at
https://geotoolsnews.blogspot.com/2019/01/geotools-21-rc-release-ready-for-testing.html
.

Ian

-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Horizontal alignment for texts along line

2019-01-10 Thread Ian Turton
Change the Geometry to use the function start_point.  See
https://docs.geoserver.org/latest/en/user/styling/sld/extensions/geometry-transformations.html#start-and-end-point

Ian

On Thu, 10 Jan 2019 at 14:55, Ron Lindhoudt via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> I have a question:
> Is there a way to tell Geotools to align a text label with the start of
> the line instead of the center of the line?
> I cannot find it in the documentation of linePlacement.
>
> The documentation is also very brief:
>
>
>-
>
>LinePlacement 
> <http://docs.geotools.org/latest/javadocs/org/geotools/styling/LinePlacement.html>
>  linePlacement(Expression 
> <http://docs.geotools.org/latest/javadocs/org/opengis/filter/expression/Expression.html>
>  offset,
>Expression 
> <http://docs.geotools.org/latest/javadocs/org/opengis/filter/expression/Expression.html>
>  initialGap,
>Expression 
> <http://docs.geotools.org/latest/javadocs/org/opengis/filter/expression/Expression.html>
>  gap,
>boolean repeated,
>boolean aligned,
>boolean generalizedLine)
>
>Specified by:linePlacement
>
> <http://docs.geotools.org/latest/javadocs/org/opengis/style/StyleFactory.html#linePlacement-org.opengis.filter.expression.Expression-org.opengis.filter.expression.Expression-org.opengis.filter.expression.Expression-boolean-boolean-boolean->
>  in
>interface StyleFactory
>
> <http://docs.geotools.org/latest/javadocs/org/opengis/style/StyleFactory.html>
>Parameters:offset - initialGap - gap - repeated - aligned -
>generalizedLine -
>
> Thanks.
> Ron Lindhoudt
> _______
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] [Geotools-devel] Query regarding getting pixel values for a given radius

2019-01-08 Thread Ian Turton
Please use the users list for questions about how to use GeoTools.

What you want to do is probably possible. The tricky bits are what
projection your tiff is in and that the zipcode (centroids?) are also in a
projected coordinate system.

Ian

On Tue, 8 Jan 2019 at 12:09, Meena Subramanian <
meena.subramania...@gmail.com> wrote:

> We are first time users of GeoTools.  Our use case is for a given tif
> image & radius,  we would like to know if there is possibility in geotools
> API to get all pixels falling within the radius  ( with zipcode ,distance
>   which can be 10km,20km or miles from zipcode  as input ) . The output
> should be pixel values from input geo location to 10kms radius.
> ___
> GeoTools-Devel mailing list
> geotools-de...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Missing Jar Files from the 20.0 release

2018-10-13 Thread Ian Turton
I'm pretty sure it is mostly just a historical artifact, i.e. we always
used to put them there.

Ian

On Sat, 13 Oct 2018 at 18:19, Peter Borissow 
wrote:

> Thanks Ian,
> I understand how to pull down the jars via maven. I also know that
> historically the downloads from SourceForge don't include all the jars. But
> why not? I guess I don't understand the point of the SourceForge bundle
> download if you need maven anyway?
>
> Peter
>
>
>
> On Saturday, October 13, 2018, 12:44:09 PM EDT, Ian Turton <
> ijtur...@gmail.com> wrote:
>
>
> Also, we have never included **all** the jars in releases, that's what
> maven is for.
>
> Ian
>
> On Sat, 13 Oct 2018 at 17:41, Ian Turton  wrote:
>
> Check out the GeoTools Upgrade notes for all the changes -
> http://docs.geotools.org/stable/userguide/welcome/upgrade.html
>
> Ian
>
> On Sat, 13 Oct 2018 at 16:57, Peter Borissow via GeoTools-GT2-Users <
> geotools-gt2-users@lists.sourceforge.net> wrote:
>
> Hello,
> I am dusting off some old code that relies on GeoTools to calculate
> distances using the org.geotools.geometry.jts.JTS class. Example:
>
> DefaultGeographicCRS crs = DefaultGeographicCRS.WGS84;
> distance = JTS.orthodromicDistance(
> coord,
> prevCoord,
> crs
> );
>
> I am building using Java 10. I tried to use some old jars from GeoTools
> 14.x but I got a runtime exception:
>
> "java.lang.IllegalArgumentException:
> org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class"
>
> After a quick search, it looks like I need to upgrade GeoTools so I
> downloaded the latest and greatest bundle from SourceForge and added all
> the jars to my project.
>
> I quickly discovered that the bundle is missing a few dependencies so I
> started hunting them down and adding them one-by-one. So far, I have added
> the following:
>
> jts-core-1.16.0
> si-units-java8-0.9
> uom-se-1.0.9
> uom-common-1.0.2
> unit-api-1.0
>
> However, I am now stuck with the following error:
> java.lang.NoClassDefFoundError: si/uom/quantity/MagnetomotiveForce
>
> Any suggestions as to where I can find this jar? Or the source code for
> the implementation of the MagnetomotiveForce interface?
>
> Also, would it be possible to include all the requisite jars in future
> releases?
>
> Thanks in advance,
> Peter
> _______
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
> --
> Ian Turton
>
>
>
> --
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Missing Jar Files from the 20.0 release

2018-10-13 Thread Ian Turton
Also, we have never included **all** the jars in releases, that's what
maven is for.

Ian

On Sat, 13 Oct 2018 at 17:41, Ian Turton  wrote:

> Check out the GeoTools Upgrade notes for all the changes -
> http://docs.geotools.org/stable/userguide/welcome/upgrade.html
>
> Ian
>
> On Sat, 13 Oct 2018 at 16:57, Peter Borissow via GeoTools-GT2-Users <
> geotools-gt2-users@lists.sourceforge.net> wrote:
>
>> Hello,
>> I am dusting off some old code that relies on GeoTools to calculate
>> distances using the org.geotools.geometry.jts.JTS class. Example:
>>
>> DefaultGeographicCRS crs = DefaultGeographicCRS.WGS84;
>> distance = JTS.orthodromicDistance(
>> coord,
>> prevCoord,
>> crs
>> );
>>
>> I am building using Java 10. I tried to use some old jars from GeoTools
>> 14.x but I got a runtime exception:
>>
>> "java.lang.IllegalArgumentException:
>> org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class"
>>
>> After a quick search, it looks like I need to upgrade GeoTools so I
>> downloaded the latest and greatest bundle from SourceForge and added all
>> the jars to my project.
>>
>> I quickly discovered that the bundle is missing a few dependencies so I
>> started hunting them down and adding them one-by-one. So far, I have added
>> the following:
>>
>> jts-core-1.16.0
>> si-units-java8-0.9
>> uom-se-1.0.9
>> uom-common-1.0.2
>> unit-api-1.0
>>
>> However, I am now stuck with the following error:
>> java.lang.NoClassDefFoundError: si/uom/quantity/MagnetomotiveForce
>>
>> Any suggestions as to where I can find this jar? Or the source code for
>> the implementation of the MagnetomotiveForce interface?
>>
>> Also, would it be possible to include all the requisite jars in future
>> releases?
>>
>> Thanks in advance,
>> Peter
>> ___
>> GeoTools-GT2-Users mailing list
>> GeoTools-GT2-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
> --
> Ian Turton
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Missing Jar Files from the 20.0 release

2018-10-13 Thread Ian Turton
Check out the GeoTools Upgrade notes for all the changes -
http://docs.geotools.org/stable/userguide/welcome/upgrade.html

Ian

On Sat, 13 Oct 2018 at 16:57, Peter Borissow via GeoTools-GT2-Users <
geotools-gt2-users@lists.sourceforge.net> wrote:

> Hello,
> I am dusting off some old code that relies on GeoTools to calculate
> distances using the org.geotools.geometry.jts.JTS class. Example:
>
> DefaultGeographicCRS crs = DefaultGeographicCRS.WGS84;
> distance = JTS.orthodromicDistance(
> coord,
> prevCoord,
> crs
> );
>
> I am building using Java 10. I tried to use some old jars from GeoTools
> 14.x but I got a runtime exception:
>
> "java.lang.IllegalArgumentException:
> org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class"
>
> After a quick search, it looks like I need to upgrade GeoTools so I
> downloaded the latest and greatest bundle from SourceForge and added all
> the jars to my project.
>
> I quickly discovered that the bundle is missing a few dependencies so I
> started hunting them down and adding them one-by-one. So far, I have added
> the following:
>
> jts-core-1.16.0
> si-units-java8-0.9
> uom-se-1.0.9
> uom-common-1.0.2
> unit-api-1.0
>
> However, I am now stuck with the following error:
> java.lang.NoClassDefFoundError: si/uom/quantity/MagnetomotiveForce
>
> Any suggestions as to where I can find this jar? Or the source code for
> the implementation of the MagnetomotiveForce interface?
>
> Also, would it be possible to include all the requisite jars in future
> releases?
>
> Thanks in advance,
> Peter
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GridCoverage sampling inconsistency

2018-09-18 Thread Ian Turton
To save others from your pain, please log a bug and then put in a PR (with
a test) so that it can be merged in.

Ian

On Tue, 18 Sep 2018 at 13:07, Nick Griffiths 
wrote:

>
> On 18/09/18 23:55, Nick Griffiths wrote:
> >> So perhaps this is an issue with the AsciiGridsImageReader?
> >
> > I think I might have found something with the asciigridsimagereader.
> > It looks like it's to do with the tile marker cache being used to find a
> > good spot to start seeking from.
> >
> > 1) In the case of freshly created grid, the tile marker cache is empty,
> > and so we are forced to seek through the entire file to find where to
> > start looking, and the reader returns the right set of values.
> >
> > 2) In the case of an adjacent tile look up, the tile marker cache gives
> > us an exact match and correctly lines up the input stream at the right
> > position.  The reader returns the right set of values.
> >
> > But in the case of the nearest lower key found in the marker cache,
> > things can go awry. I can see that the skipping code in this instance
> > seems to put is in at the wrong position.  Given that case 1) works,
> > which uses the same skipping code,  I must assume that the marker cache
> > is returning the wrong result here (possibly either the wrong sample
> > position or the wrong seek position?) or is being misused in a way that
> > results in derived results being poisoned?
>
> Eureka!
>
> So it's an off by one error when reusing those cached skip positions.
>
> https://paste.dollyfish.net.nz/540649
>
> This diff seems to fix it for my particular asc file - I don't quite
> understand why it works, and whether it's particular to the layout of
> this particular file or something else.
>
> Anyway, I've got to the bottom of most of it, more to come tomorrow.
>
>
>
> _______
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GeoTools versioning

2018-09-18 Thread Ian Turton
For historical reasons (i.e. I can't remember why) GeoTools releases are
listed on the GeoServer schedule (
https://github.com/geoserver/geoserver/wiki/Release-Schedule). You will
always get release announcements on the GeoTools user list (i.e. this one)
and at the GeoTools blog (http://geotoolsnews.blogspot.com/).

Ian

On Tue, 18 Sep 2018 at 10:31, Yaniv Ben-Yosef  wrote:

> Hi,
>
> I've done some googling, but I can't seem to find a page that lists all
> versions of GeoTools, most importantly all stable releases. Is there such a
> list somewhere?
> Is 19.2 the latest stable release? Is there a stable version after 20-RC?
> Finally, is there a way in which I can get notified about new releases?
>
> Thanks,
> Yaniv Ben-Yosef
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] ImageMosaicJDBC with oracle georaster error

2018-09-17 Thread Ian Turton
Please don't use nabble to post to the list as it strips out the xml and
formatting of your message making it impossible to help you.  Please join
the mailing list and participate in the community that you are asking for
help.

See this video <https://vimeo.com/144089061> or this presentation
<https://www.ianturton.com/talks/foss4g.html> for a better idea of how to
approach this sort of request.

Ian

On Mon, 17 Sep 2018 at 07:53, Mohammed Kabeer  wrote:

> Dear All
>
> i  am trying to all datasource for ImageMosaicJDBC with oracle georaster.
>
> i successfully copied plugin and i can see ImageMosaicJDBC in the stores
> also.
>
> i created raster_config.xml for my raster data configuration and stored in
> styles/coverage/raster_config.xml
>
> i am calling this xml from the datasource but giving following error
>
> can some one look at it
>
> Could not list layers for this store, an error occurred retrieving them:
> Failed to create reader from
> file:styles/coverages/GeoServer_Raster_Config.xml and hints Hints:
> REPOSITORY = org.geoserver.catalog.CatalogRepository@6cbd32df
> EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@6800d03
> [Running,
> pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
> System defaults: GRID_COVERAGE_FACTORY = GridCoverageFactory TILE_ENCODING
> =
> null STYLE_FACTORY = StyleFactoryImpl FILTER_FACTORY = FilterFactoryImpl
> LENIENT_DATUM_SHIFT = true FORCE_LONGITUDE_FIRST_AXIS_ORDER = true
> FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@7f6345f0
> FORCE_AXIS_ORDER_HONORING = http COMPARISON_TOLERANCE = 1.0E-8
>
> Thanks
> Kabeer
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/geotools-gt2-users-f4317834.html
>
>
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>


-- 
Ian Turton
___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] NTv2Transform error - unable to locate file

2018-07-25 Thread Ian Turton
I'm not sure if this is the issue but the preferred way to change a file
into an url is to use the Urls.toUrl method.

Ian

On Tue, 24 Jul 2018, 21:46 Stanislav Dušek,  wrote:

> Hello,
>
> I'm trying to use GeoTools to calculate the grid coverage based on NTv2
> .gsb file.
> However, I'm unable to create the instance of NTv2Transform.
> When I use this piece of code:
>
> File gridFile = new File("C:\\Dev\\VTS\\Grids\\WA\\wohpgn.gsb");
> NTv2Transform transform = new NTv2Transform(gridFile.toURI());
>
> I get this exception:
>
> Exception in thread "main"
> org.opengis.referencing.NoSuchIdentifierException: Could not locate NTv2
> Grid File file:/C:/Dev/VTS/Grids/WA/wohpgn.gsb
> at
> org.geotools.referencing.operation.transform.NTv2Transform.(NTv2Transform.java:105)
> at
> com.frequentis.example.Main.transformFromNad27UsingGrid(Main.java:75)
> at com.frequentis.example.Main.main(Main.java:90)
>
> Am I using the syntax properly?
> Is there some other way of how to achieve that?
> Do you know about some workaround?
>
> Btw, I was trying it with versions 18.4 and 19.1 with Maven.
>
> Thank you,
> Stanislav
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


[Geotools-gt2-users] GeoTools 18.4 released

2018-06-20 Thread Ian Turton
The GeoTools team is delighted to announce the release of GeoTools 18.4,
this is the final planned release of this branch and users should consider
migrating away from it in the near future.

See the blog post
<http://geotoolsnews.blogspot.com/2018/06/geotools-184-released.html> for
more details.

-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] [Geotools-devel] An issue about showing more than one shpfilesusing Swing component

2018-04-16 Thread Ian Turton
First you create a JMapFrame and a MapContent to put in it

JMapFrame frame = new JMapFrame();

  private MapContent content = new MapContent();

  public MapViewer(String[] args) {
frame.setSize(300, 300);

frame.enableToolBar(true);
frame.enableStatusBar(true);
frame.setMapContent(content);

}

Then for each Shapefile (or other datasource) you create a layer and add it
to the MapContent

HashMap<String, Object> params = new HashMap<>();
File f = new File(name);
params.put("url", URLs.fileToUrl(f));
DataStore ds = null;
try {
  ds = DataStoreFinder.getDataStore(params);
} catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}
if (ds == null) {
  System.err.println("couldn't find a store for " + name);
  return;
}
String type;
try {
  type = ds.getTypeNames()[0];

  FeatureLayer layer = new FeatureLayer(ds.getFeatureSource(type),
style);
  System.out.println("adding layer " + name);

  content.addLayer(layer);
} catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}

I've attached the full example to this message.

On 11 April 2018 at 02:42, NBA浪仔 <799052...@qq.com> wrote:

> Thanks,I realize showing one map in a JPanel according to the URL(
> https://github.com/sf2gis/SwingMap), but I don't konw how to realize
> adding two map contents in a mapPane,could you give me a demo about it?
>
>
> -- 原始邮件 --
> *发件人:* "Ian Turton"<ijtur...@gmail.com>;
> *发送时间:* 2018年4月11日(星期三) 凌晨1:26
> *收件人:* "NBA浪仔"<799052...@qq.com>;"geotools-users" gt2-us...@lists.sourceforge.net>;
> *主题:* Re: [Geotools-devel] An issue about showing more than one
> shpfilesusing Swing component
>
> Instead of creating a new mapPane for each layer you need to create just a
> new layer and add that to the existing map content object.
>
> Ian
>
> On Tue, 10 Apr 2018, 02:11 NBA浪仔, <799052...@qq.com> wrote:
>
>> Thanks a lot for your replay . Actually, I have realized the goal that
>> one panel displays one shp map ,
>> But I want to display two maps in one JPanel like this ,any suggestions?
>> Otherwise,I want to realize zooming in and out in this JPanel,how should
>> I do that?
>>
>>
>>
>> -- 原始邮件 --
>> *发件人:* "Ian Turton"<ijtur...@gmail.com>;
>> *发送时间:* 2018年4月10日(星期二) 凌晨0:34
>> *收件人:* "NBA浪仔"<799052...@qq.com>;
>> *抄送:* "geotools-devel"<geotools-de...@lists.sourceforge.net>;
>> *主题:* Re: [Geotools-devel] An issue about showing more than one shp
>> filesusing Swing component
>>
>> You need to create a second layer and add that to the map in exactly the
>> same way as the first.
>>
>> Ian
>>
>> On 9 April 2018 at 11:32, NBA浪仔 <799052...@qq.com> wrote:
>>
>>> Dear Sir/Madam,
>>> With your help earlier,I can display one shp format map file in
>>> a JPanel component,like this :
>>>
>>>
>>> Now I want to display two shp format map files in the Swing component
>>> --JPanel,how should I do that?
>>>
>>> Yours sincerely,
>>> Ouyang
>>>
>>>
>>>
>>>
>>> 
>>> --
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> ___
>>> GeoTools-Devel mailing list
>>> geotools-de...@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>>
>>>
>>
>>
>> --
>> Ian Turton
>>
>


-- 
Ian Turton
package com.ianturton.geotools;

import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.geotools.data.DataStore;
import org.geotools.data.DataStoreFinder;
import org.geotools.map.FeatureLayer;
import org.geotools.map.MapContent;
import org.geotools.styling.SLD;
import org.geotools.styling.Style;
import org.geotools.styling.StyledLayerDescriptor;
import org.geotools.swing.JMapFrame;
import org.geotools.util.URLs;
import org.xml.sax.SAXException;

public class MapViewer {
  JMapFrame frame = new JMapFrame();

  private MapContent content = new MapContent();

  public MapViewer(String[] args) {
frame.setSize(300, 3

Re: [Geotools-gt2-users] [Geotools-devel] An issue about showing more than one shp filesusing Swing component

2018-04-10 Thread Ian Turton
Instead of creating a new mapPane for each layer you need to create just a
new layer and add that to the existing map content object.

Ian

On Tue, 10 Apr 2018, 02:11 NBA浪仔, <799052...@qq.com> wrote:

> Thanks a lot for your replay . Actually, I have realized the goal that one
> panel displays one shp map ,
> But I want to display two maps in one JPanel like this ,any suggestions?
> Otherwise,I want to realize zooming in and out in this JPanel,how should I
> do that?
>
>
>
> -- 原始邮件 --
> *发件人:* "Ian Turton"<ijtur...@gmail.com>;
> *发送时间:* 2018年4月10日(星期二) 凌晨0:34
> *收件人:* "NBA浪仔"<799052...@qq.com>;
> *抄送:* "geotools-devel"<geotools-de...@lists.sourceforge.net>;
> *主题:* Re: [Geotools-devel] An issue about showing more than one shp
> filesusing Swing component
>
> You need to create a second layer and add that to the map in exactly the
> same way as the first.
>
> Ian
>
> On 9 April 2018 at 11:32, NBA浪仔 <799052...@qq.com> wrote:
>
>> Dear Sir/Madam,
>> With your help earlier,I can display one shp format map file in a
>> JPanel component,like this :
>>
>>
>> Now I want to display two shp format map files in the Swing component
>> --JPanel,how should I do that?
>>
>> Yours sincerely,
>> Ouyang
>>
>>
>>
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> GeoTools-Devel mailing list
>> geotools-de...@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>
>
> --
> Ian Turton
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] problem connection to postgres

2018-04-06 Thread Ian Turton
Geotools will use whatever username and password you put in the parameters
map you pass into the datastore finder. So you can use whichever user you
like.

Ian

On Fri, 6 Apr 2018, 16:34 ,  wrote:

>
>
>
> Hello List,
>
> I'm trying to connect from my Java program to my
> Postgresql 9.2.  The Geotools jars I am using
> aparently try to connect to postgres using the "Geotools"
> user.
>
> The problem is, acoording what i've just read in Postgres
> forum, in the case sensitive condition in user name.
>
> (Postgres is expecting "geotools" username, instead of
> "Geotools".)
>
> My working platform:
>
> -Windows 10
> -Postgresql 9.2
> -Java 8
> -Geotools 18
>
> I appreciate if you could help me.
>
> Julio.
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] GetMapRequest

2018-02-23 Thread Ian Turton
I think the easiest answer is to request two separate images on either side
of 180/-180.

Some of the data stores handle crossing the antimeridian or possibly that
is all handled in GeoServer (see
http://blog.geoserver.org/2010/02/23/geoserver-map-wrapping/). So you might
get the correct answer by using a WMSLayer rather than making a direct WMS
request yourself, but I haven't tried that.

Ian

On 23 February 2018 at 00:20, Andrea Mari <andrea.m...@niwa.co.nz> wrote:

> I send it again because with the attachment was too big.
>
>
>
> Thank you very much, it works now.
>
>
>
> Now that I’ve solved my issue, I’ve got a second one.
>
>
>
> The real coordinates I’m using to create a rectangle in the South pacific
> are
>
> getMapRequest.setBBox("162,-24,-156,17");
>
> but due to the fact that I’m going through the 0 meridian, the Envelope
> doesn’t recognise correctly the minx and maxX (it swaps them)
>
> I’ve also tried to use 162 and 203 (assuming to use a 360 degree scale)
>
>
>
> Any idea?
>
>
>
> Thank you
>
> Andrea
>
>
>
> *From: *Andrea Mari <andrea.m...@niwa.co.nz>
> *Date: *Friday, 23 February 2018 at 1:18 PM
> *To: *Ian Turton <ijtur...@gmail.com>
> *Cc: *"geotools-gt2-users@lists.sourceforge.net" <
> geotools-gt2-users@lists.sourceforge.net>
> *Subject: *Re: [Geotools-gt2-users] GetMapRequest
>
>
>
> Thank you very much, it works now.
>
>
>
> Now that I’ve solved my issue, I’ve got a second one.
>
>
>
> The real coordinates I’m using to create a rectangle in the South pacific
> are
>
> getMapRequest.setBBox("162,-24,-156,17");
>
> but due to the fact that I’m going through the 0 meridian, the Envelope
> doesn’t recognise correctly the minx and maxX (it swaps them)
>
> I’ve also tried to use 162 and 203 (assuming to use a 360 degree scale)
>
>
>
> Any idea?
>
>
>
> Attached a picture of the area I would like to get from the server.
>
>
>
> Thank you
>
> Andrea
>
>
>
>
>
> *From: *Ian Turton <ijtur...@gmail.com>
>
> *Date: *Thursday, 22 February 2018 at 10:31 PM
> *To: *Andrea Mari <andrea.m...@niwa.co.nz>
> *Cc: *"geotools-gt2-users@lists.sourceforge.net" <
> geotools-gt2-users@lists.sourceforge.net>
> *Subject: *Re: [Geotools-gt2-users] GetMapRequest
>
>
>
> That URL and bounding box work fine for me, using this code
> https://gitlab.com/snippets/1700238
>
> If it fetches the whole world it is possible you are not setting the
> bounds of your map viewport, so you may need to add something like (where
> content is your MapContent):
>
> content.getViewport().setCoordinateReferenceSystem(crs);
> content.getViewport().setBounds(bbox);
>
> Ian
>
>
>
> On 22 February 2018 at 03:11, Andrea Mari <andrea.m...@niwa.co.nz> wrote:
>
> Hello all,
>
>
>
> I’m trying to get a subset of the WGS84 map from a server but it doesn’t
> work the way I expect.
>
> It just keeps showing the whole world
>
>
>
> What am I doing wrong?
>
>
>
>   MultithreadedHttpClient httpClient = new MultithreadedHttpClient();
>
>   httpClient.setReadTimeout(timeout);
>
>   httpClient.setConnectTimeout(timeout);
>
>   WebMapServer wms = new WebMapServer(new URL(serviceUrl), httpClient);
>
>   WMSCapabilities capabilities = wms.getCapabilities();
>
>   List layers = capabilities.getLayerList();
>
>   defaultWMSLayer = GeoToolsUtils.getDefaultWMSLayer(layers);
>
>   wmsLayer = new RSWMSLayer(wms, defaultWMSLayer);
>
>
>
>   GetMapRequest getMapRequest = wms.createGetMapRequest();
>
>   getMapRequest.addLayer(defaultWMSLayer);
>
>   getMapRequest.setBBox("162,-24,175,-13");
>
>   getMapRequest.setDimensions(mapPane.getSize());
>
>   getMapRequest.setFormat("image/png");
>
>   getMapRequest.setSRS("CRS:" + CRS.toSRS(crs));
>
>
>
>   wmsLayer.setTitle(defaultWMSLayer.getTitle());
>
>   map.layers().add(0, wmsLayer);
>
>
>
>
>
> serviceUrl =http://ows.terrestris.de/osm/service?SERVICE=WMS=1.
> 1.1=GetCapabilities
>
> ("162,-24,175,-13") these are the coordinates in WGS84 to get a map of
> most of the Pacific Islands
>
>
>
> Thank you very much for your help
>
> Andrea
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-User

Re: [Geotools-gt2-users] GetMapRequest

2018-02-22 Thread Ian Turton
That URL and bounding box work fine for me, using this code
https://gitlab.com/snippets/1700238

If it fetches the whole world it is possible you are not setting the bounds
of your map viewport, so you may need to add something like (where content
is your MapContent):

content.getViewport().setCoordinateReferenceSystem(crs);
content.getViewport().setBounds(bbox);

Ian

On 22 February 2018 at 03:11, Andrea Mari <andrea.m...@niwa.co.nz> wrote:

> Hello all,
>
>
>
> I’m trying to get a subset of the WGS84 map from a server but it doesn’t
> work the way I expect.
>
> It just keeps showing the whole world
>
>
>
> What am I doing wrong?
>
>
>
>   MultithreadedHttpClient httpClient = new MultithreadedHttpClient();
>
>   httpClient.setReadTimeout(timeout);
>
>   httpClient.setConnectTimeout(timeout);
>
>   WebMapServer wms = new WebMapServer(new URL(serviceUrl), httpClient);
>
>   WMSCapabilities capabilities = wms.getCapabilities();
>
>   List layers = capabilities.getLayerList();
>
>   defaultWMSLayer = GeoToolsUtils.getDefaultWMSLayer(layers);
>
>   wmsLayer = new RSWMSLayer(wms, defaultWMSLayer);
>
>
>
>   GetMapRequest getMapRequest = wms.createGetMapRequest();
>
>   getMapRequest.addLayer(defaultWMSLayer);
>
>   getMapRequest.setBBox("162,-24,175,-13");
>
>   getMapRequest.setDimensions(mapPane.getSize());
>
>   getMapRequest.setFormat("image/png");
>
>   getMapRequest.setSRS("CRS:" + CRS.toSRS(crs));
>
>
>
>   wmsLayer.setTitle(defaultWMSLayer.getTitle());
>
>   map.layers().add(0, wmsLayer);
>
>
>
>
>
> serviceUrl =http://ows.terrestris.de/osm/service?SERVICE=WMS=1.
> 1.1=GetCapabilities
>
> ("162,-24,175,-13") these are the coordinates in WGS84 to get a map of
> most of the Pacific Islands
>
>
>
> Thank you very much for your help
>
> Andrea
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] Geotools

2018-02-20 Thread Ian Turton
I think what you are seeing is the same issue as
https://osgeo-org.atlassian.net/projects/GEOT/issues/GEOT-5920.

Ian

On 19 February 2018 at 21:21, Ryan Schachte <c...@ryan-schachte.com> wrote:

> Hi Ian,
>
> I'm stuck at a crossroads on this issue I've been tackling for over a week
> now. I'm utilizing the filter functions feature of geotools that is
> supported in the filter 2.0 spec. The functions are working great, aside
> from one problem.
>
> This works:
>
> (attName >= replacementFunc() AND title like 'test') AND attName2 = 
> replacementFunc()
>
>
> This doesn't:
>
> (attName >= replacementFunc() AND title like replacementFunc()) AND attName2 
> = replacementFunc()
>
> The problem is that I have a function on the RHS of the "like" statement,
> which is throwing a parsing error. I was analyzing the schema, and this
> should be supported. I threw some manually generated XML into an XML
> verification tool and it passed. Do you have any specific information on
> this in regards to allowing functions on the right hand side of something
> that isn't a binary logical operator?
>
> Thanks a bunch,
>
>
> Ryan Schachte
> P: +1 480.452.8825 <+1+480.452.8825>
> E: c...@ryan-schachte.com
> Ryan-Schachte.com
>
>


-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] How do I get a list of available layers for a WFS service

2018-01-11 Thread Ian Turton
I can't currently see a way to extract the titles from the WFSCapabilities
document, you would need something like:

   WFSClient client = wfsFeatureSource.getWFS();
   WFSGetCapabilities cap = client.getCapabilities();
for(EObject obj:cap.getParsedCapabilities().eContents()) {
 //examine object to find featuretype and extract title
}

Ian

On 11 January 2018 at 02:44, Gabriella Turek <gabriella.tu...@niwa.co.nz>
wrote:

> I have a further question on this. When I get the list of layers from the
> server, it’s a list of useless layer names such as “layer-234”, rather than
> a human readable (and informative) title. The title is buried in the
> WFSCapabilities object and I cannot see any way to get them out.
>
> Is there a way?
>
> (Since I can get the titles if I put the URL into QGIS, I am assuming that
> the server is not necessarily misconfigured).
>
> Thanx
>
> Gaby
>
>
>
> *From: *Ian Turton <ijtur...@gmail.com>
> *Date: *Monday, 8 January 2018 at 22:22
> *To: *Gabriella Turek <gabriella.tu...@niwa.co.nz>
> *Cc: *"geotools-gt2-users@lists.sourceforge.net" <
> geotools-gt2-users@lists.sourceforge.net>
> *Subject: *Re: [Geotools-gt2-users] How do I get a list of available
> layers for a WFS service
>
>
>
> Sorry for not replying before, I'm not sure I saw that email.
>
>
>
> Anyway, first construct a WFSDataStore
>
>
>
> Map<String, Object> params = new HashMap<>();
>
> params.put(WFSDataStoreFactory.URL.key, baseURL);
>
> if (auth) {
>
>   params.put(WFSDataStoreFactory.USERNAME.key, user);
>
>   params.put(WFSDataStoreFactory.PASSWORD.key, passwd);
>
> }
>
> // params.put(WFSDataStoreFactory.WFS_STRATEGY.key, "mapserver");
>
> datastore = DataStoreFinder.getDataStore(params);
>
>
>
> Then simply ask for the typeNames
>
>
>
> String[] names = datastore.getTypeNames();
>
>
>
> and then for any name you can grab a featureSource
>
>
>
> SimpleFeatureSource source = datastore.getFeatureSource(name);
>
>
>
> and features:
>
>
>
> SimpleFeatureCollection features = source.getFeatures(query);
>
>
>
> Hope that helps
>
>
>
> Ian
>
>
>
>
>
> On 7 January 2018 at 20:21, Gabriella Turek <gabriella.tu...@niwa.co.nz>
> wrote:
>
> Hi all, I am sending this again as I did not get any replies before Xmas.
>
> I am trying to implement a WFS service client in our app, but I can’t
> figure out how to get a list of available layers from the initial
> getCapabilities request.
>
> Something akin to what one can do for WMS:
>
> WebMapServer wms = null;
>
> try {
>
> wms = new WebMapServer(url);
>
> WMSCapabilities capabilities = wms.getCapabilities();
>
> Layer[] layers = WMSUtils.getNamedLayers(capabilities);
>
> if (layers == null || layers.length == 0) {
>
> return "the server does not provide any layers.";
>
> }
>
> } catch (Exception e) {}
>
>
>
>
> ----
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>
>
>
> --
>
> Ian Turton
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] [Geotools-devel] Replace values in a coverage that instersect with a vector geometry

2018-01-09 Thread Ian Turton
(Redirected to user list where it should live)

Here is some working code (
https://gist.github.com/ianturton/e54c41169ef32f48b1ac9b93c580e165) - but I
suspect it could be much more efficient.

Ian

On 9 January 2018 at 11:27, Ian Turton <ijtur...@gmail.com> wrote:

> There may be a better way than this but I would start by creating the new
> raster
>
> WritableRaster writableRaster = RasterFactory.
> createBandedRaster(java.awt.image.DataBuffer.TYPE_DOUBLE, width,
> height, 1, null);
> GridCoverageFactory factory = CoverageFactoryFinder.
> getGridCoverageFactory(null);
> GridCoverage2D gc = factory.create("ResPop", writableRaster, bounds);
>
> copying the old one in to it and then clipping my raster to the envelope
> of the polygon
>
>  public GridCoverage2D clip(GridCoverage2D coverage, ReferencedEnvelope
> envelope) {
> CoverageProcessor processor = CoverageProcessor.getInstance();
>
> // An example of manually creating the operation and parameters we want
> final ParameterValueGroup param = processor.getOperation("
> CoverageCrop").getParameters();
> param.parameter("Source").setValue(coverage);
> param.parameter("Envelope").setValue(envelope);
>
> return (GridCoverage2D) processor.doOperation(param);
>
>   }
>
> and then step through the remaining pixels - checking if the centre(?) was
> in the polygon and changing them as required
>
> GridEnvelope gridRange2D = grid.getGridGeometry().getGridRange();
> for(int i=gridRange2D.getLow(0);i<gridRange2D.getHigh(0);i++) {
>   for(int j=gridRange2D.getLow(1);j<gridRange2D.getHigh(1);j++) {
>   Point2D p = grid.gridToWorld(new GridCoordinate2D(i,j));
>   if(poly.contains(p)){
> int[] dest = new int[1];
> grid.evaluate(new GridCoordinates2D(i, j), dest );
> System.out.println(i+","+j+"="+dest[0]);
> writableRaster.setDataElements(c.x, c.y, data);
>  }
>   }
> }
>
> I haven't actually tested any of this but it looks plausible
>
> Ian
>
> On 9 January 2018 at 09:41, Jan Boonen <jan.boo...@geodan.nl> wrote:
>
>> Hi list,
>>
>> For a complex GIS editing application I want to use GeoTools to replace
>> values in a coverage. The cells, whose values need to be replaced, must be
>> selected using an intersection with a JTS Geometry. All editing may be done
>> on in-memory coverages, only the end result will be written to a file.
>>
>> I have read through the tutorials and JavaDoc, but thus far I haven't
>> been able to figure out how to do an intersection on a coverage and how to
>> replace the value of individual cells. Would anybody be so kind to give me
>> some hints?
>>
>> Thanks in advance!
>>
>> Cheers,
>>
>> Jan
>>
>> 
>> ----------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> GeoTools-Devel mailing list
>> geotools-de...@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>
>
> --
> Ian Turton
>



-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] How do I get a list of available layers for a WFS service

2018-01-08 Thread Ian Turton
Sorry for not replying before, I'm not sure I saw that email.

Anyway, first construct a WFSDataStore

Map<String, Object> params = new HashMap<>();
params.put(WFSDataStoreFactory.URL.key, baseURL);
if (auth) {
  params.put(WFSDataStoreFactory.USERNAME.key, user);
  params.put(WFSDataStoreFactory.PASSWORD.key, passwd);
}
// params.put(WFSDataStoreFactory.WFS_STRATEGY.key, "mapserver");
datastore = DataStoreFinder.getDataStore(params);

Then simply ask for the typeNames

String[] names = datastore.getTypeNames();

and then for any name you can grab a featureSource

SimpleFeatureSource source = datastore.getFeatureSource(name);

and features:

SimpleFeatureCollection features = source.getFeatures(query);

Hope that helps

Ian


On 7 January 2018 at 20:21, Gabriella Turek <gabriella.tu...@niwa.co.nz>
wrote:

> Hi all, I am sending this again as I did not get any replies before Xmas.
>
> I am trying to implement a WFS service client in our app, but I can’t
> figure out how to get a list of available layers from the initial
> getCapabilities request.
>
> Something akin to what one can do for WMS:
>
> WebMapServer wms = null;
>
> try {
>
> wms = new WebMapServer(url);
>
> WMSCapabilities capabilities = wms.getCapabilities();
>
> Layer[] layers = WMSUtils.getNamedLayers(capabilities);
>
> if (layers == null || layers.length == 0) {
>
> return "the server does not provide any layers.";
>
> }
>
> } catch (Exception e) {}
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


Re: [Geotools-gt2-users] [Geotools-admin] ImageLab error

2017-11-15 Thread Ian Turton
Pauline,

The admin list is for the project administrators to discuss project
management. Questions like this should go to the GeoTools Users list
(cc'd).

Yes, the problem is most likely that you haven't used Maven to build your
project as this handles all the dependencies required for you.

Ian

On 15 November 2017 at 15:16, Pauline Perbet <pauline.perbe...@ulaval.ca>
wrote:

> Helo,
>
> I downloaded the geotools-18.0-bin, and add the Jar in the BuildPath in
> Oracle.
>
> I installed all the JAI and ImageIO.
>
> But the ImageLab tutorial not working (http://docs.geotools.org/
> latest/userguide/_downloads/ImageLab.java​) ...
>
> It is because I don't use MAVEN to install Geotools??
>
> Thanks for your help.
>
> Pauline
>
>
> nov. 15, 2017 10:14:11 AM org.geotools.factory.FactoryRegistry
> scanForPlugins
> WARNING: Can't load a service for category "GridFormatFactorySpi". Cause
> is "ServiceConfigurationError: 
> org.geotools.coverage.grid.io.GridFormatFactorySpi:
> Provider org.geotools.gce.imagemosaic.ImageMosaicFormatFactory could not
> be instantiated".
> java.util.ServiceConfigurationError: 
> org.geotools.coverage.grid.io.GridFormatFactorySpi:
> Provider org.geotools.gce.imagemosaic.ImageMosaicFormatFactory could not
> be instantiated
>
> ()
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Geotools-administration mailing list
> geotools-administrat...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-administration
>
>


-- 
Ian Turton
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


  1   2   3   4   >