sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M. Le Bihan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SIS-187) Reduce visibility of Shapefile fields
Date Mon, 07 Dec 2015 14:28:10 GMT

    [ https://issues.apache.org/jira/browse/SIS-187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15045007#comment-15045007
] 

M. Le Bihan edited comment on SIS-187 at 12/7/15 2:27 PM:
----------------------------------------------------------

I think we can see this subject more in detail when we will attempt to read a .prj file.

I've found this example on the Internet, this is why I took the example of _envelope.getLower("latitude")_
as it was the name of one axis in the following .prj :

{code}GEODCRS["WGS 84",
  DATUM["World Geodetic System 1984",
    ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1.0]]],
  CS[ellipsoidal,2],
    AXIS["latitude",north,ORDER[1]],
    AXIS["longitude",east,ORDER[2]],
    ANGLEUNIT["degree",0.01745329252],
  ID["EPSG",4326]]{code}

But I have not always this information. French metropolitan cities outlines has this .prj
:
{code}PROJCS["RGF93_Lambert_93",
  GEOGCS["GCS_RGF_1993",
     DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137.0,298.257222101]
  ],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",700000.0],
PARAMETER["False_Northing",6600000.0],
PARAMETER["Central_Meridian",3.0],
PARAMETER["Standard_Parallel_1",44.0],
PARAMETER["Standard_Parallel_2",49.0],
PARAMETER["Latitude_Of_Origin",46.5],
UNIT["Meter",1.0]
]{code}

where no axis are declared.

And Guadeloupean cities outlines have only a readme.txt file mentionning : "_UTM Nord fuseau
20_"...

If you read a random shapefile from the Internet, and that you tell : "_I don't trust that
X, Y, Z axis given by getX...(), getY...(), getZ...() really represent the X, Y, Z axis._",
then you have to find a way to return from the .prj file the true axis that are used, and
not the ones you believe you should find. 
In example : if a funny creator of shapefile has wished to use it's Z axis for time (and had
put an Axis label on it naming it "time"), you must not put a direction on this axis designing
EAST.or NORTH, but OTHER I think.

So it's a big study before attempting anything.


was (Author: mlebihan):
I think we can see this subject more in detail when we will attempt to read a .prj file.

I've found this example on the Internet, this is why I took the example of _envelope.getLower("latitude")_
as it was the name of one axis in the following .prj :

{code}GEODCRS["WGS 84",
  DATUM["World Geodetic System 1984",
    ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1.0]]],
  CS[ellipsoidal,2],
    AXIS["latitude",north,ORDER[1]],
    AXIS["longitude",east,ORDER[2]],
    ANGLEUNIT["degree",0.01745329252],
  ID["EPSG",4326]]{code}

But I have not always this information. French metropolitan cities outlines has this .prj
:
{code}PROJCS["RGF93_Lambert_93",
  GEOGCS["GCS_RGF_1993",
     DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137.0,298.257222101]
  ],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",700000.0],
PARAMETER["False_Northing",6600000.0],
PARAMETER["Central_Meridian",3.0],
PARAMETER["Standard_Parallel_1",44.0],
PARAMETER["Standard_Parallel_2",49.0],
PARAMETER["Latitude_Of_Origin",46.5],
UNIT["Meter",1.0]
]{code}

where no axis are declared.

And Guadeloupean cities outlines have only a readme.txt file mentionning : "_UTM Nord fuseau
20_"...

If you read a random shapefile from the Internet, and that you tell : "_I don't trust that
X, Y, Z axis given by getX...(), getY...(), getZ...() really represent the X, Y, Z axis._",
then you have to find a way to return from the .prj file the true axis that are used, and
not the ones you believe you should find. 
In example : if a funny creator of shapefile has wished to use it's Z axis for time (and had
put an Axis label on it naming it "time"), you must not put a direction on this axis designing
EAST.or NORTH.

> Reduce visibility of Shapefile fields
> -------------------------------------
>
>                 Key: SIS-187
>                 URL: https://issues.apache.org/jira/browse/SIS-187
>             Project: Spatial Information Systems
>          Issue Type: Sub-task
>          Components: Shapefile
>            Reporter: Martin Desruisseaux
>            Assignee: M. Le Bihan
>              Labels: JDBC, Shapefile
>             Fix For: 0.7
>
>
> The {{Shapefile}} implementation contains many fields, and all of them are currently
public. Probably many of them could be private. Below is a list of fields with a guess of
whether users are likely to want this information, and how he could obtain it.
> h3. Fields that could be considered internal mechanic
> * {{FileCode}}: currently used only in {{Shapefile.toString()}} implementation without
explanation.
> * {{FileLength}}: currently used only in {{Shapefile.toString()}} implementation. Potentially
useful to the {{Shapefile}} reader itself, but unlikely to be useful to external user since
getting a useful meaning from a file length require knowledge of the file format structure.
> * {{Version}}: currently used only in {{Shapefile.toString()}} implementation. Not clear
if it is the file format version or the dataset version. In the former case, this is an important
information for the {{Shapefile}} reader but less for other users. In the later case, it could
be an ISO metadata property.
> * {{dbf}}: a pointer to the underlying {{Database}} object. May be a dangerous things
to expose. If nevertheless we really want to give direct access to the DBF database, maybe
we should return a JDBC {{Connection}} instead.
> h3. Information to be made accessible through a public API
> * {{xmin}}, {{ymin}}, {{xmax}}, {{ymax}}: the spatial extent of the data. Could be made
accessible through the ISO 19115 {{GeographicBoundingBox}} element. However it is unclear
if those elements are always expressed in a geographic CRS or if they can be in a projected
CRS.
> * {{zmin}}, {{zmax}}: the vertical extent of the data. Could be made accessible through
the ISO 19115 {{VerticalExtent}} element. However the {{VerticalCRS}} of that extent is currently
unknown.
> * {{main}}, {{mmax}}: the javadoc does not said what those values are.
> * {{FeatureMap}}: the set of {{Feature}} is indeed important, but maybe we should return
them through some kind of iterator (or a JDK8 {{Stream}} ?) for fetching data on-demand (in
a later implementation, not necessarily now) rather than loading all of them at {{Shapefile}} construction
time.
> h3. Open questions
> * {{ShapeType}}: currently used only in {{Shapefile.toString()}} implementation. Tells
whether the geometries are points, polygons, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message