2

I don't find a way to see the 11 points of my set of data that are just meters from each other as separate points in GeoServer and I don't know why. I would have assumed that GeoServer finds the correct resolution through calculating the boundary box but that doesn't seem to help. Maybe you can reproduce it given the following information:

I have the following table in PostgreSQL 13.2 with PostGIS 3.1 (currently on windows 10 but setting up a linux server to move to that)

                          Tabelle ╗public.samplepoints½
   Spalte    |         Typ          | Sortierfolge | NULL erlaubt? | Vorgabewert
-------------+----------------------+--------------+---------------+-------------
 sampleid    | integer              |              | not null      |
 sampletag   | smallint             |              |               |
 sampletype  | smallint             |              |               |
 samplegeom  | geometry(Point,3035) |              |               |
Indexe:
    "treesamples_pkey" PRIMARY KEY, btree (sampleid)

with the following data:

 sampleid | sampletag | sampletype |                     samplegeom                     
----------+-----------+------------+----------------------------------------------------
        1 |     20523 |        949 | 0101000020DB0B0000EF8DAD60850123409ECB585D1C7A4940 
        8 |     20530 |        949 | 0101000020DB0B00008DC19DA4AD0123407C4B488A197A4940 
        2 |     20524 |        837 | 0101000020DB0B000057BB699C8D012340FC7DBFCB1E7A4940 
        3 |     20525 |        949 | 0101000020DB0B0000E86C4F7985012340F84EED881A7A4940 
        4 |     20526 |        188 | 0101000020DB0B0000825218C28F012340F211BC171B7A4940 
        5 |     20527 |        356 | 0101000020DB0B0000EC2ED81E99012340BF414BBC1B7A4940 
        6 |     20528 |        578 | 0101000020DB0B0000F8CFA08F9C0123406BF6A09D1C7A4940 
        7 |     20529 |        554 | 0101000020DB0B00005B4CFA9FA60123400D74F77D1B7A4940 
        9 |     20531 |        578 | 0101000020DB0B00007574EB5CA90123401EED730D177A4940 
       10 |     20532 |        239 | 0101000020DB0B000072F269319B012340B350770D167A4940 
       11 |     20533 |        748 | 0101000020DB0B0000B38462578D012340EB350836187A4940 

Then I create a workspace "sampleworkspace" in GeoServer and a store "samplestore" with access to PostGIS. Finally, I create a layer from sampleworkspace:samplestore in which I publish samplepoints from PostGIS. I keep the referencing system as EPSG 3035 and let the layer's bounding boxes be calculated from the data which results in

Min X        | Min Y        | Max X        | Max Y
9,5029707157 | 50,953797992 | 9,5032779162 | 50,954064816
Lat/Lon
Min X              | Min Y              | Max X              | Max Y
-29,08689230212812 | 12,994046968698024 | -29,08689229881456 | 12,994046972307304

So my 11 points are very close to each other.

A preview of the layer as OpenLayers only shows me one point and the scale is set to 1:2 which means I cannot zoom in any closer, only zoom out further. When I click on that one point, it gives me all 11 points: samplepoints

fid             | sampletag | sampletype 
samplepoints.1  | 20523     | 949        
samplepoints.8  | 20530     | 949        
samplepoints.2  | 20524     | 837        
samplepoints.3  | 20525     | 949        
samplepoints.4  | 20526     | 188        
samplepoints.5  | 20527     | 356        
samplepoints.6  | 20528     | 578        
samplepoints.7  | 20529     | 554        
samplepoints.9  | 20531     | 578        
samplepoints.10 | 20532     | 239        
samplepoints.11 | 20533     | 748       

Is there any way to see the 11 points as separated points, so to go "beyond 1:2" or to adjust the scaling in a different way?

6
  • how are you viewing the points?
    – Ian Turton
    Commented May 25, 2021 at 12:31
  • I just click on "OpenLayers" in Layer Preview. I don't use OpenLayers yet but it is offered by default and then behaves like this. I have not changed any settings.
    – user184042
    Commented May 25, 2021 at 12:58
  • That is for a quick check on your data - use a proper client and you will be able to zoom in as far as you like.
    – Ian Turton
    Commented May 25, 2021 at 13:18
  • And a proper client would e.g. be OpenLayers? Sorry, I'm all new to this and trying to find my way around.
    – user184042
    Commented May 25, 2021 at 13:20
  • QGIS, a custom OpenLayers or Leaflet client page, arcmap, curl almost anything
    – Ian Turton
    Commented May 25, 2021 at 13:33

1 Answer 1

5

The coordinates you are showing are not in 3035 but likely in lat-long, with values that are out of bounds for this projection. (i.e your code claims 3035 but the values are 4326). When converting these bad coordinates to 3857 for display, they are indeed all - more or less a few atoms - on top of each others.

Here is an example of a suitable value for 3035:

select st_asText(st_transform(st_geomFromEWKT('SRID=4326;POINT(9.5 50.95)'),3035));
                st_astext
------------------------------------------
 POINT(4285862.99121434 3093300.32637788)
6
  • I can play around with different projections but I inserted the points using 3035 unless I misunderstood how to do that. E.g. for the first point, I used ST_GeomFromText('POINT(50.95399062 9.5029707157)', 3035) when inserting the data into my PostGIS table.
    – user184042
    Commented May 25, 2021 at 13:32
  • that's your problem then, those are almost certainly 4326
    – Ian Turton
    Commented May 25, 2021 at 13:34
  • Why don't you try loading the data with SRID set to 4326 and let us know the result?
    – user965586
    Commented May 25, 2021 at 13:37
  • Thank you, I'll try that. Just copied quickly and obviously reversed them there. I'll have a lot of learning ahead of me. ;)
    – user184042
    Commented May 25, 2021 at 13:52
  • 1
    @JGH Done. I didn't find the correct way to accept it last night. Learned something again.
    – user184042
    Commented May 26, 2021 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.