Re: [Geotools-devel] Set HTTP proxy for XML SchemaCache

2024-06-03 Thread Cécile Vuilleumier
Great, yes the change would be in the method doing the actual download 
(https://github.com/geotools/geotools/blob/main/modules/library/xml/src/main/java/org/geotools/xml/resolver/SchemaCache.java#L235) 
and the XML caching mechanism would not / should not be impacted.


I will work on a PR but further feedback is of course welcome

On 5/31/24 4:41 PM, Jody Garnett wrote:

That is … amazing you can get in there and make the change. Wow.

For normal XML parsing does it use the cache?



--
Jody Garnett


On Fri, May 31, 2024 at 2:22 AM Cécile Vuilleumier 
 wrote:


Hi all

This is a follow-up to:
https://osgeo-org.atlassian.net/browse/GEOT-7576 (Make SchemaCache
use the HttpClient from the GeoTools hints)

The goal would be to be able to configure an HTTP proxy for XML
schema requests using the GeoTools hint HTTP_CLIENT_FACTORY
(similarly to OWS requests). If not set the fallback would be the
SimpleHttpClient.

I have been looking at the code and it seems doable, although the
SchemaCache does something special in order to follow HTTP
redirections. An option could be to move this to the
SimpleHttpClient GET method or to overload this method.
(Note that after testing it seems HttpURLConnection does already
follow redirects but only if they have the same protocol e.g. HTTP
or HTTPS)

Would you be in favor of this change? Any comments about the
implementation?

Thanks in advance, Cécile

-- 
*camptocamp*


*Cécile Vuilleumier
*
Geospatial developer
www.camptocamp.com <http://www.camptocamp.com>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] Set HTTP proxy for XML SchemaCache

2024-05-31 Thread Cécile Vuilleumier

Hi all

This is a follow-up to: https://osgeo-org.atlassian.net/browse/GEOT-7576 
(Make SchemaCache use the HttpClient from the GeoTools hints)


The goal would be to be able to configure an HTTP proxy for XML schema 
requests using the GeoTools hint HTTP_CLIENT_FACTORY (similarly to OWS 
requests). If not set the fallback would be the SimpleHttpClient.


I have been looking at the code and it seems doable, although the 
SchemaCache does something special in order to follow HTTP redirections. 
An option could be to move this to the SimpleHttpClient GET method or to 
overload this method.
(Note that after testing it seems HttpURLConnection does already follow 
redirects but only if they have the same protocol e.g. HTTP or HTTPS)


Would you be in favor of this change? Any comments about the implementation?

Thanks in advance, Cécile
--
*camptocamp*

*Cécile Vuilleumier
*
Geospatial developer
www.camptocamp.com <http://www.camptocamp.com>___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] Bug when graphic-margin is greater than marker size

2023-12-19 Thread Cécile Vuilleumier

Good question, yes it works like in CSS and it's mostly handled here:
https://github.com/geotools/geotools/blob/main/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java#L1127
https://github.com/geotools/geotools/blob/main/modules/library/render/src/main/java/org/geotools/renderer/VendorOptionParser.java#L114
So in markToTilableImage() the margin is either null or an array of 4 ints

On 12/19/23 4:38 PM, Jody Garnett wrote:
That looks good; and the change to the reference image covers your 
need for a test case.


Question: you assume the margin is an array of 4 numbers.

Does it work like with CSS where an array of a single number, or an 
array of two numbers could be provided?


--
Jody Garnett


On Tue, Dec 19, 2023 at 7:33 AM Cécile Vuilleumier 
 wrote:


Hi all

I am back again on the topic of polygon fill with repeated markers
(see https://osgeo-org.atlassian.net/browse/GEOT-7357)
Unfortunately my fix did introduce an unwanted side effect: if the
given margin is greater than the marker size, an error is thrown
and the layer is not drawn:
org.geotools.renderer.lite: x lies outside raster  -> it happens
on this line

<https://github.com/geotools/geotools/blob/9df403d52baf8f099d8d9569b7399a1b1906568a/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java#L1263>

Here is a proposed fix:

https://github.com/vuilleumierc/geotools/commit/b94415a586fdb86a923b072a9ad26af92c83b278

Is it OK for me to open an issue and a PR?

Cheers, Cécile

-- 
*camptocamp*

*Cécile Vuilleumier
*
Geospatial developer
www.camptocamp.com <http://www.camptocamp.com>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] Bug when graphic-margin is greater than marker size

2023-12-19 Thread Cécile Vuilleumier

Hi all

I am back again on the topic of polygon fill with repeated markers (see 
https://osgeo-org.atlassian.net/browse/GEOT-7357)
Unfortunately my fix did introduce an unwanted side effect: if the given 
margin is greater than the marker size, an error is thrown and the layer 
is not drawn:
org.geotools.renderer.lite: x lies outside raster  -> it happens on this 
line 
<https://github.com/geotools/geotools/blob/9df403d52baf8f099d8d9569b7399a1b1906568a/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java#L1263>


Here is a proposed fix: 
https://github.com/vuilleumierc/geotools/commit/b94415a586fdb86a923b072a9ad26af92c83b278


Is it OK for me to open an issue and a PR?

Cheers, Cécile
--
*camptocamp*
*Cécile Vuilleumier
*
Geospatial developer
www.camptocamp.com <http://www.camptocamp.com>___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


[Geotools-devel] Polygon fill with markers, rotation and margins

2023-05-08 Thread Cécile Vuilleumier

Hello all,

This is a follow-up to: 
https://sourceforge.net/p/geoserver/mailman/geoserver-users/thread/9c182de7-da6d-7ba8-0689-a4ecd29e3381%40camptocamp.com/#msg37788010
The issue was initially reported to us by a customer for rotated markers 
(ESRI font) with margins. For non-rotated symbols (as in my initial 
message), it seems the problem is visible only for certain resolutions 
(for me: when working with a very large screen, or by adding the 
parameter "&FORMAT_OPTIONS=dpi:96" to the GetMap request).


After locally debugging the code, it appears that the margin between 
symbols is not taken into account when creating the 3x3 grid and when 
clipping the subimage from it (that is, the central symbol that will be 
used for tiling). The margin is added afterwards (outside the 
markToTilableImage() function) thus resulting in broken up symbols.


I have a branch which addresses the issue and hopefully does not 
introduce any regression (the unit tests are passing and I also did some 
manual testing):
https://github.com/vuilleumierc/geotools/commit/e9af35eeaf5984e7f6b6514c5f9c03a6846e5aaa 



I am also attaching two images (actual result and result with proposed 
solution) and the corresponding SLD file.
Would you consider a PR for this, and if yes do we need a JIRA ticket to 
open one? If more info is needed, let me know.


Thanks in advance for your consideration and best regards,
Cécile
--
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

*Cécile Vuilleumier
*
Geospatial developer
*
*
*Camptocamp SA*
Route de la Chaux 4
Bâtiment A (Feuille)
1030 Bussigny
Switzerland
+41 62 544 03 77 (direct)
+41 21 619 10 10 (central)
www.camptocamp.com <http://www.camptocamp.com>
http://www.opengis.net/sld StyledLayerDescriptor.xsd"
   xmlns="http://www.opengis.net/sld";
   xmlns:ogc="http://www.opengis.net/ogc";
   xmlns:xlink="http://www.w3.org/1999/xlink";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  
  
default_polygon

  
  Polygon
  A sample style that draws a polygon
  
  
  

  rule1
  Marker fill
  
5

  

  
triangle

  #4e4e4e
  1.0


  #00
  0
  1.0

  
  1.0
  24
  45

  

  
  

  #4e4e4e
  1
  1.0

  

  

  


___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel