You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Siddhesh Rane <Si...@disroot.org> on 2017/08/02 17:25:39 UTC

Re: JavaFX application progress

Hello Martin 

The CRS editor is now functioning and connected to the CRS list. You can right click on a chosen CRS and click edit to see the pane in action. 

For the prime meridian you have asked for a combo box. But upon analyzing the class there doesn't seem to be an enumerable type. What are the other options that can be used to populate the combo box and how to get them? 

---- Martin Desruisseaux wrote ----

> Could you give an example? If a ReferenceSystem.getName() does not
> return a proper value, it may be an issue to investigate.

It will return the name when we have GeodeticCRS. But in case of ProjectedCRS with a base geod CRS it will return empty result. 

> It may be useful to have the semi-major and semi-minor fields disposed
> vertically, since it make easier to visually compare their numerical value.
> 
> The "Bounding Box" and "Area" field could be collectively be named
> "Domain of validity". Both provides the same information, but in
> different way.

Both changes done. 

Regards 
Siddhesh Rane 

Re: JavaFX application progress

Posted by Siddhesh Rane <si...@disroot.org>.
Hello Martin,

I have added a fxml mock "Feature Editor" for gpx files. Please have a look at it and comment.

August 8, 2017 4:29 AM, "Martin Desruisseaux" <ma...@geomatys.com> wrote:

> Le 07/08/2017 à 18:24, Siddhesh Rane a écrit :
> 
> I understand that tabs may be more convenient during development, but at
> least the first tab about Apache SIS configuration should move in an
> "About Apache SIS" menu item.

I have moved it to the About menu. 
 
> As a side note, the current widget leaves the "semi-major" and
> "semi-minor" fields to zero. Those values can be fetched by
> Datum.getEllipsoid().getSemiMajor() and ...getSemiMinor().

I am already using that. Some CRS at the beginning like EPSG:2000 don't seem to have datum definitions. Try EPSG:4244 Kandawala, ellipsoid information loads for that one.
 
As a side note, I am currently setting SIS_DATA environment variable to point to a local installation on my hard disk. I tried adding sis-epsg maven module as a runtime dependency but it seems sis doesnt pick it up. There is warning about missing SIS_DATA variable and the factory being used is EPSGFactoryFallback. Am I missing something here?

> For the prime meridian, we should show the "Greenwich longitude"
> somewhere, maybe just on the right side of "Prime Meridian" combo box.

Done

Regards 
Siddhesh

Re: JavaFX application progress - Final report

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Siddhesh

The link gives a good description of your work - I think it is fit the
Google's requirements. I would suggest to add a section about how this
work would be integrated in Apache SIS. The current plan is to integrate
in the JDK9 branch (because Jigsaw modularisation makes the use of
JavaFX a little bit easier). Code would be integrated piece by piece by
trying to complete some parts in the process.

    Martin


Le 28/08/2017 à 19:33, Siddhesh Rane a écrit :

> I have prepared a final report for the work done during this GSoC
> according to Google's work product submission guidelines. Report is
> available in the README at https://github.com/SiddheshRane/sis-client.
> It documents the functionality implemented so far with screenshots
> acting like user manual. Mentors are requested to suggest any changes
> before the final submission tomorrow.
>


Re: JavaFX application progress - Final report

Posted by Siddhesh Rane <si...@disroot.org>.
Hello all,

I have prepared a final report for the work done during this GSoC according to Google's work product submission guidelines. Report is available in the README at https://github.com/SiddheshRane/sis-client. It documents the functionality implemented so far with screenshots acting like user manual. 
Mentors are requested to suggest any changes before the final submission tomorrow.

Regards
Siddhesh Rane

Re: JavaFX application progress

Posted by Siddhesh Rane <si...@disroot.org>.
Hello Martin, 

---- Martin Desruisseaux wrote ----

> The changes that you did looks good. I noticed a little oddity, the
> geographic bounding box in the metadata tab had a North and East value
> but no South and West value (at least on the NetCDF file I used for the
> test).

In the latest commit I have fixed this problem along with a detailed commit message explaining it's cause. I have also removed unused dependencies from pom. 

> > dm = new DefaultMetadata(datastore.getMetadata() )
> >
> > dm.isModifiable() returns true, but the actual setvalue operation
> > throws an error.
> >
> Can you send me the stack trace?

I have attached the stack trace. The mailing list will remove attachments so check the direct message that you have received from me. 

I'm preparing a report for work product submission according to gsoc guidelines. It will replace the README file at my repo. It needs to be approved by the mentor. I'll let you know know when that is done. Till then you can tell me anything you want included in that. 

Regards 
Siddhesh Rane

Re: JavaFX application progress

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Siddhesh

The changes that you did looks good. I noticed a little oddity, the
geographic bounding box in the metadata tab had a North and East value
but no South and West value (at least on the NetCDF file I used for the
test).

Le 20/08/2017 à 21:34, Siddhesh Rane a écrit :

> The metadata cells will use Node.setValue() for updating changes. The
> underlying treetable gives unsupported operation exception. I tried
>
> dm = new DefaultMetadata(datastore.getMetadata() )
>
> dm.isModifiable() returns true, but the actual setvalue operation
> throws an error.
>
Can you send me the stack trace?

    Martin



Re: JavaFX application progress

Posted by Siddhesh Rane <Si...@disroot.org>.
A quick update 

Home tab has been removed. The user directly sees the file tab and a list of CRS tab. 
The menu bar has open feature and an about window where we display project name, logo, clickable website link and configuration information. 

MetadataView has had code clean-up. 
All treetable related code is in NodeTreeTable which extends TreeTableView , used for About window. 

Metadata is shown by MetadataTable which extends NodeTreeTable. 
Configuration management is moved to Config class. It can capture state of a NodeTreeTable,  store it,  modify it later and delete it. This is meant for different views for different types of metadata. 

CRSEditor updates all values when you switch to different CRS in the combo box. If any property is modified the name is changed to "Modified <authority:code>" . A progress indicator is shown whenever CRS is being loaded. 

The metadata cells will use Node.setValue() for updating changes. 
The underlying treetable gives unsupported operation exception. 

I tried 
dm = new DefaultMetadata(datastore.getMetadata() ) 

dm.isModifiable() returns true, but the actual setvalue operation throws an error. 

Regards 
Siddhesh Rane 

---- Martin Desruisseaux wrote ----

>Hello Siddhesh
>
>Le 09/08/2017 à 19:26, Siddhesh Rane a écrit :
>
>I have moved it to the About menu.
>
>Thanks. Since the "Home" tab is now empty, do we need to keep it?
>
>The "About" dialog box contains directly the tree with all details. Shouldn't the dialog box contains at least a title (e.g. "About Apache SIS" with link to the project) with the tree below that?
>
>
>I am already using that. Some CRS at the beginning like EPSG:2000 don't seem to have datum definitions. Try EPSG:4244 Kandawala, ellipsoid information loads for that one.
>
>All CRS should have datum definition. But EPSG:2000 is a projected CRS while EPSG:4244 is a geodetic CRS. In the former case, the datum is more indirect. To get it:
>
>if (crs instanceof SingleCRS) { Datum datum = ((SingleCRS) crs).getDatum(); if (datum instanceof GeodeticDatum) { Ellipsoid ellps = ((GeodeticDatum) datum).getEllipsoid(); } } 
>
>The above works for both GeographicCRS and ProjectedCRS.
>
>
>As a side note, I am currently setting SIS_DATA environment variable to point to a local installation on my hard disk. I tried adding sis-epsg maven module as a runtime dependency but it seems sis doesnt pick it up. There is warning about missing SIS_DATA variable and the factory being used is EPSGFactoryFallback. Am I missing something here?
>
>How do you set SIS_DATA? You can verify if it was really setup by printing the value of System.getenv("SIS_DATA") in your application.
>
>
>Le 13/08/2017 à 05:20, Siddhesh Rane a écrit :
>
>The CRSEditor uses a combo box for the CRS name and a list of registered CRS is shown. There is search as you type functionality provided using controlsfx.
>
>Nice. But when I select another name, I did not see the other values being updated accordingly, or did I miss something? For example if we select "EPSG:4326 - WGS84", I would expect the ellipsoid semi-major, semi-minor, etc. to be updated accordingly. Conversely, if I modify an ellipsoid axis length, then the name should not be "EPSG:4326 - WGS84" anymore since I changed the definition.
>
>
>The coordinate system combo box lists all available epsg coordinate systems.
>
>I propose to rename the label as "Coordinate systems" instead than "Coordinate system types". The types would be "Cartesian", "Spherical", etc., but what the combo box shows is rather instances (e.g. Cartesian with axis in metres oriented to North and East, etc.), which are more specific than types.
>
>The list of coordinate systems could be filtered according the type of CRS. For example in the CRS is a GeographicCRS, then only coordinate systems with latitude, longitude and optionally a height axes should be proposed. Conversely if the CRS is a ProjectedCRS, then only coordinate systems with linear units (metres, feet, kilometre, etc.) should be proposed.
>
>
>The axes dimensions table below it gets populated based on your choice of coordinate system. I suppose there is no requirement to manually add/delete/modify the axes dimensions.
>
>Right. We may want manual add/delete/modify, but that would be after this GSoC.
>
>
>In the case of a custom CRS does the user ever have to create it from scratch or just a minor variation on one of the existing CRS?
>
>I suggest to do variation of an existing CRS for now (no creation from scratch). However as said above, if a CRS is modified, then its name can not be "EPSG:something" anymore, so the combo box on the top should automatically become "Unnamed" or something like that (and the users will have to provide the name themselves).
>
>
>How do I store the new values in the metadata? The tree table has setValue method
>
>That setValue method should work. It may be the easiest approach.
>
>
>FeatureEditor has separate tabs for Waypoints, routes and tracks. The Waypoints table lists some common columns like name lat,  lon,  elevation, description and time. Editing support is available for name, lat, lon.
>
>This is a nice start, but the waypoints, routes and tracks are specific to GPX data. Other data (Shapefile, etc.) will have completely different data. Consequently, the table and columns need to be created dynamically.
>
>
>In the sis-features api I couldn't find a way to get typed attribute value; only object is returned. I had to run sample files and then check the return types at runtime. eg lat and long are obtained from sis:geometry which returns a Point from esri geometry api.
>
>You can get the type as below:
>
>FeatureType type = feature.getType(); PropertyType pt = type.getProperty("name"); if (pt instanceof AttributeType) { Class<?> valueClass = ((AttributeType) pt).getValueClass(); } 
>
>
>As for creating new instances of features, I checked test suite of sis-features api where there is choice between sparse and dense features.
>
>The distinction betwwen "sparse" versus "dense" features is an implementation details. The approach proposed above should make abstraction of that.
>
>
>Also how do store these changes back into a file? 
>
>The API for feature types is not yet frozen. It may be worth to skip the saving part for now.
>
>    Martin
>
>

Re: JavaFX application progress

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Siddhesh

Le 09/08/2017 à 19:26, Siddhesh Rane a écrit :

> I have moved it to the About menu.
>
Thanks. Since the "Home" tab is now empty, do we need to keep it?

The "About" dialog box contains directly the tree with all details.
Shouldn't the dialog box contains at least a title (e.g. "About Apache
SIS" with link to the project) with the tree below that?


> I am already using that. Some CRS at the beginning like EPSG:2000
> don't seem to have datum definitions. Try EPSG:4244 Kandawala,
> ellipsoid information loads for that one.
>
All CRS should have datum definition. But EPSG:2000 is a projected CRS
while EPSG:4244 is a geodetic CRS. In the former case, the datum is more
indirect. To get it:

    if (crs instanceof SingleCRS) {
        Datum datum = ((SingleCRS) crs).getDatum();
        if (datum instanceof GeodeticDatum) {
            Ellipsoid ellps = ((GeodeticDatum) datum).getEllipsoid();
        }
    }

The above works for both GeographicCRS and ProjectedCRS.


> As a side note, I am currently setting SIS_DATA environment variable
> to point to a local installation on my hard disk. I tried adding
> sis-epsg maven module as a runtime dependency but it seems sis doesnt
> pick it up. There is warning about missing SIS_DATA variable and the
> factory being used is EPSGFactoryFallback. Am I missing something here?
>
How do you set SIS_DATA? You can verify if it was really setup by
printing the value of System.getenv("SIS_DATA") in your application.


Le 13/08/2017 à 05:20, Siddhesh Rane a écrit :

> The CRSEditor uses a combo box for the CRS name and a list of
> registered CRS is shown. There is search as you type functionality
> provided using controlsfx.
>
Nice. But when I select another name, I did not see the other values
being updated accordingly, or did I miss something? For example if we
select "EPSG:4326 - WGS84", I would expect the ellipsoid semi-major,
semi-minor, etc. to be updated accordingly. Conversely, if I modify an
ellipsoid axis length, then the name should not be "EPSG:4326 - WGS84"
anymore since I changed the definition.


> The coordinate system combo box lists all available epsg coordinate
> systems.
>
I propose to rename the label as "Coordinate systems" instead than
"Coordinate system types". The types would be "Cartesian", "Spherical",
etc., but what the combo box shows is rather instances (e.g. Cartesian
with axis in metres oriented to North and East, etc.), which are more
specific than types.

The list of coordinate systems could be filtered according the type of
CRS. For example in the CRS is a GeographicCRS, then only coordinate
systems with latitude, longitude and optionally a height axes should be
proposed. Conversely if the CRS is a ProjectedCRS, then only coordinate
systems with linear units (metres, feet, kilometre, etc.) should be
proposed.


> The axes dimensions table below it gets populated based on your choice
> of coordinate system. I suppose there is no requirement to manually
> add/delete/modify the axes dimensions.
>
Right. We may want manual add/delete/modify, but that would be after
this GSoC.


> In the case of a custom CRS does the user ever have to create it from
> scratch or just a minor variation on one of the existing CRS?
>
I suggest to do variation of an existing CRS for now (no creation from
scratch). However as said above, if a CRS is modified, then its name can
not be "EPSG:something" anymore, so the combo box on the top should
automatically become "Unnamed" or something like that (and the users
will have to provide the name themselves).


> How do I store the new values in the metadata? The tree table has
> setValue method

That setValue method should work. It may be the easiest approach.


> FeatureEditor has separate tabs for Waypoints, routes and tracks. The
> Waypoints table lists some common columns like name lat,  lon, 
> elevation, description and time. Editing support is available for
> name, lat, lon.

This is a nice start, but the waypoints, routes and tracks are specific
to GPX data. Other data (Shapefile, etc.) will have completely different
data. Consequently, the table and columns need to be created dynamically.


> In the sis-features api I couldn't find a way to get typed attribute
> value; only object is returned. I had to run sample files and then
> check the return types at runtime. eg lat and long are obtained from
> sis:geometry which returns a Point from esri geometry api.
>
You can get the type as below:

    FeatureType type = feature.getType();
    PropertyType pt = type.getProperty("name");
    if (pt instanceof AttributeType) {
        Class<?> valueClass = ((AttributeType) pt).getValueClass();
    }


> As for creating new instances of features, I checked test suite of
> sis-features api where there is choice between sparse and dense features.
>
The distinction betwwen "sparse" versus "dense" features is an
implementation details. The approach proposed above should make
abstraction of that.


> Also how do store these changes back into a file?
>
The API for feature types is not yet frozen. It may be worth to skip the
saving part for now.

    Martin



Re: JavaFX application progress

Posted by Siddhesh Rane <Si...@disroot.org>.
Hello all, 

Project update :

The CRSEditor uses a combo box for the CRS name and a list of registered CRS is shown. There is search as you type functionality provided using controlsfx. 

The coordinate system combo box lists all available epsg coordinate systems. 
The axes dimensions table below it gets populated based on your choice of coordinate system. I suppose there is no requirement to manually add/delete/modify the axes dimensions. Correct me if I am wrong. 

In the case of a custom CRS does the user ever have to create it from scratch or just a minor variation on one of the existing CRS?

The MetadataView > reference System Info shows just the name of the CRS with an edit hyperlink that opens a dialog box with the CRSEditor. 

GeographicExtent and VerticalExtent editors can create new objects using DefaultGeaographicBoundingBox and DefaultVerticalExtent constructors. I suppose the same method will work for all other types. How do I store the new values in the metadata? 
-The tree table has setValue method
-I could create DefaultMetadata from users given metadata and then use setter methods. 
What is the right approach? 

FeatureEditor has separate tabs for Waypoints, routes and tracks. The Waypoints table lists some common columns like name lat,  lon,  elevation, description and time. Editing support is available for name, lat, lon. 
In the sis-features api I couldn't find a way to get typed attribute value; only object is returned. I had to run sample files and then check the return types at runtime. eg lat and long are obtained from sis:geometry which returns a Point from esri geometry api. 
As for creating new instances of features, I checked test suite of sis-features api where there is choice between sparse and dense features. Here too the property/attribute name and the value object type needs to be known before hand. 
Also how do store these changes back into a file? 

Regards 
Siddhesh Rane 

---- Martin Desruisseaux wrote ----

>Le 07/08/2017 à 18:24, Siddhesh Rane a écrit :
>
>> >What about making it a dialog box instead than part of the CRS pane?
>> (...snip...)
>>
>> CRSEditor can be embedded anywhere, even in dialog box.
>>
>Yes, this is nice. But the application currently uses tabs, with "About
>SIS" information, data files, metadata, Coordinate Reference System
>(CRS) all at the same level. I think that for most users, the entry
>point will be their data file. Then (s)he can see the metadata of their
>file, and one part of the metadata is the CRS. So the CRS dialog box
>would be opened by editing the "Reference System" node on the metadata page.
>
>I understand that tabs may be more convenient during development, but at
>least the first tab about Apache SIS configuration should move in an
>"About Apache SIS" menu item.
>
>
>> I have changed it to org.apache.sis.desktop, similar to the
>> sis-console module. The artifact would be a part of "applications"
>> submodule.
>>
>Thanks for the renaming. Yes, the plan is to port the code to the
>"applications" submodule.
>
>
>> When editing CRS when I have to update certain fields, what pattern
>> needs to be followed? Do I
>> * call setValue if available
>> * create a new object by calling constructor
>> * use a factory method like DatumFactory.createPrimeMeridian
>>
>There is no "setValue" on CRS objects. All CRS are immutable on design,
>because (typically) thousands of geometries and other objects will share
>a reference to the same CRS. New objects need to be created by calls to
>DatumFactory, CSFactory and CRSFactory methods.
>
>As a side note, the current widget leaves the "semi-major" and
>"semi-minor" fields to zero. Those values can be fetched by
>Datum.getEllipsoid().getSemiMajor() and ...getSemiMinor().
>
>For the prime meridian, we should show the "Greenwich longitude"
>somewhere, maybe just on the right side of "Prime Meridian" combo box.
>
>
>> Also once the CRS is edited where is it supposed to be stored?
>>
>In the metadata, under "Reference system" node. The proposed action
>would be to have no CRS tab, but instead an "edit" button for the
>"metadata.referenceSystem" node. This edit button would popup the CRS
>editor in a dialog box. The first "name" field could be an editable
>combo-box with the list of all CRS, plus a "user defined" choice. If the
>user select one of the names in the list, all values in the dialog box
>are updated accordingly but are unmodifiable. If the user selects
>"user-defined", the values become modifiable.
>
>    Martin
>
>

Re: JavaFX application progress

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 07/08/2017 à 18:24, Siddhesh Rane a écrit :

> >What about making it a dialog box instead than part of the CRS pane?
> (...snip...)
>
> CRSEditor can be embedded anywhere, even in dialog box.
>
Yes, this is nice. But the application currently uses tabs, with "About
SIS" information, data files, metadata, Coordinate Reference System
(CRS) all at the same level. I think that for most users, the entry
point will be their data file. Then (s)he can see the metadata of their
file, and one part of the metadata is the CRS. So the CRS dialog box
would be opened by editing the "Reference System" node on the metadata page.

I understand that tabs may be more convenient during development, but at
least the first tab about Apache SIS configuration should move in an
"About Apache SIS" menu item.


> I have changed it to org.apache.sis.desktop, similar to the
> sis-console module. The artifact would be a part of "applications"
> submodule.
>
Thanks for the renaming. Yes, the plan is to port the code to the
"applications" submodule.


> When editing CRS when I have to update certain fields, what pattern
> needs to be followed? Do I
> * call setValue if available
> * create a new object by calling constructor
> * use a factory method like DatumFactory.createPrimeMeridian
>
There is no "setValue" on CRS objects. All CRS are immutable on design,
because (typically) thousands of geometries and other objects will share
a reference to the same CRS. New objects need to be created by calls to
DatumFactory, CSFactory and CRSFactory methods.

As a side note, the current widget leaves the "semi-major" and
"semi-minor" fields to zero. Those values can be fetched by
Datum.getEllipsoid().getSemiMajor() and ...getSemiMinor().

For the prime meridian, we should show the "Greenwich longitude"
somewhere, maybe just on the right side of "Prime Meridian" combo box.


> Also once the CRS is edited where is it supposed to be stored?
>
In the metadata, under "Reference system" node. The proposed action
would be to have no CRS tab, but instead an "edit" button for the
"metadata.referenceSystem" node. This edit button would popup the CRS
editor in a dialog box. The first "name" field could be an editable
combo-box with the list of all CRS, plus a "user defined" choice. If the
user select one of the names in the list, all values in the dialog box
are updated accordingly but are unmodifiable. If the user selects
"user-defined", the values become modifiable.

    Martin



Re: JavaFX application progress

Posted by Siddhesh Rane <Si...@disroot.org>.

Sent from my Sony Xperia™ smartphone

---- Martin Desruisseaux wrote ----

>What about making it a dialog box instead than part of the CRS pane? A later version could have two tabs: one which is the current one, and one for the Well Known Text. I'm not suggest to do that now; just planing for future evolution.

CRSEditor can be embedded anywhere, even in dialog box. 

> As a side note, I see many exceptions like below when running the application. Could you fix?

It's related to spinners being initialized from fxml. This exception was being thrown at fxml.load() time. I tried many options but so far I have partially solved the problem. 

> Another note: the package name should be changed in order to start with "org.apache.sis". It could be for instance "org.apache.sis.desktop" (I suggest to avoid "client" since it may have other meaning unrelated to desktop application).

I have changed it to org.apache.sis.desktop, similar to the sis-console module. The artifact would be a part of "applications" submodule. 

When editing CRS when I have to update certain fields, what pattern needs to be followed? Do I 
* call setValue if available 
* create a new object by calling constructor 
* use a factory method like DatumFactory.createPrimeMeridian 

Also once the CRS is edited where is it supposed to be stored? 

Regards 
Siddhesh Rane 

Re: JavaFX application progress

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Siddhesh

Le 02/08/2017 à 19:25, Siddhesh Rane a écrit :

> The CRS editor is now functioning and connected to the CRS list. You
> can right click on a chosen CRS and click edit to see the pane in action.
>
Thanks, it is a good start. What about making it a dialog box instead
than part of the CRS pane? A later version could have two tabs: one
which is the current one, and one for the Well Known Text. I'm not
suggest to do that now; just planing for future evolution.


> For the prime meridian you have asked for a combo box. But upon
> analyzing the class there doesn't seem to be an enumerable type. What
> are the other options that can be used to populate the combo box and
> how to get them?
>
You can do as below (this is not the most efficient way, but we can
start like that):

    CRSAuthorityFactory factory = CRS.getAuthorityFactory("EPSG");
    if (factory instanceof DatumAuthorityFactory) {
        DatumAuthorityFactory df = (DatumAuthorityFactory);
        Set<String> codes = df.getAuthorityCodes(PrimeMeridian.class);
        for (String code : codes) {
            PrimeMeridian pm = df.createPrimeMeridian(code);
        }
    }

As a side note, I see many exceptions like below when running the
application. Could you fix?

    Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double
    	at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
    	(...snip...)
    	at sis.client.metadata.GeographicExtentBox.<init>(GeographicExtentBox.java:54)
    	at sis.client.crs.CRSEditor.setValues(CRSEditor.java:130)


Another note: the package name should be changed in order to start with
"org.apache.sis". It could be for instance "org.apache.sis.desktop" (I
suggest to avoid "client" since it may have other meaning unrelated to
desktop application).

    Martin