You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by GitBox <gi...@apache.org> on 2021/05/25 13:21:17 UTC

[GitHub] [sis] alexismanin opened a new pull request #22: fix(NetCDF): Ignore unrecognized dimensions

alexismanin opened a new pull request #22:
URL: https://github.com/apache/sis/pull/22


   I've encountered this error in a project (not able to provide sample file at the moment):
   
   ```logs
   Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
   	at org.apache.sis.internal.netcdf.FeatureSet$Iter.tryAdvance(FeatureSet.java:851)
   ```
   
   From my understanding, decoder has failed to detect spatio-temporal axes. However, it still attempted to create a spatial dataset.
   
   *Note*: I'm **not** fully sure of my fix. I've decided to ignore the target dimension. Maybe I should have allowed creation of a feature set, but add security to avoid errors later and provide non georeferenced records.
   
   Any advice appreciated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sis] desruisseaux commented on a change in pull request #22: fix(NetCDF): Ignore unrecognized dimensions

Posted by GitBox <gi...@apache.org>.
desruisseaux commented on a change in pull request #22:
URL: https://github.com/apache/sis/pull/22#discussion_r638787075



##########
File path: storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.properties
##########
@@ -45,3 +45,4 @@ UnexpectedDimensionForVariable_4  = Variable \u201c{1}\u201d in file \u201c{0}\u
 UnknownProjectionParameters_2     = Unknown projection parameters in file \u201c{0}\u201d: {1}
 UnmappedDimensions_4              = Variable \u201c{1}\u201d in file \u201c{0}\u201d has {2,number} dimensions but only {3,number} can be associated to a coordinate reference system.
 UnsupportedDataType_3             = NetCDF file \u201c{0}\u201d uses unsupported data type {2} for variable \u201c{1}\u201d.
+NoSupportedAxisForDimension_2     = Cannot find any valid axis for dimension {0} in file {1}.

Review comment:
       For consistency with other messages, {0} and {1} should be between quotes if their values are expected to be strings. Note that quotes use Unicode characters are different in English and French, so I suggest to do a copy-and-paste from another line.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sis] desruisseaux commented on a change in pull request #22: fix(NetCDF): Ignore unrecognized dimensions

Posted by GitBox <gi...@apache.org>.
desruisseaux commented on a change in pull request #22:
URL: https://github.com/apache/sis/pull/22#discussion_r638788693



##########
File path: storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.properties
##########
@@ -45,3 +45,4 @@ UnexpectedDimensionForVariable_4  = Variable \u201c{1}\u201d in file \u201c{0}\u
 UnknownProjectionParameters_2     = Unknown projection parameters in file \u201c{0}\u201d: {1}
 UnmappedDimensions_4              = Variable \u201c{1}\u201d in file \u201c{0}\u201d has {2,number} dimensions but only {3,number} can be associated to a coordinate reference system.
 UnsupportedDataType_3             = NetCDF file \u201c{0}\u201d uses unsupported data type {2} for variable \u201c{1}\u201d.
+NoSupportedAxisForDimension_2     = Cannot find any valid axis for dimension {0} in file {1}.

Review comment:
       Currently, keys are in alphabetical order. I'm not sure it is the best order, but it may be worth to preserve it for now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sis] desruisseaux commented on a change in pull request #22: fix(NetCDF): Ignore unrecognized dimensions

Posted by GitBox <gi...@apache.org>.
desruisseaux commented on a change in pull request #22:
URL: https://github.com/apache/sis/pull/22#discussion_r638785620



##########
File path: storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources_fr.properties
##########
@@ -50,3 +50,4 @@ UnexpectedDimensionForVariable_4  = La variable \u00ab\u202f{1}\u202f\u00bb dans
 UnknownProjectionParameters_2     = Param\u00e8tres de projection inconnus dans le fichier \u00ab\u202f{0}\u202f\u00bb\u00a0: {1}
 UnmappedDimensions_4              = La variable \u00ab\u202f{1}\u202f\u00bb dans le fichier \u00ab\u202f{0}\u202f\u00bb a {2,number} dimensions mais seulement {3,number} peuvent \u00eatre associ\u00e9es \u00e0 un syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es.
 UnsupportedDataType_3             = Le fichier netCDF \u00ab\u202f{0}\u202f\u00bb utilise un type de donn\u00e9es non-support\u00e9 {2} pour la variable \u00ab\u202f{1}\u202f\u00bb.
+NoSupportedAxisForDimension_2     = Aucun axe valide trouvé pour la dimension {0} dans le fichier {1}

Review comment:
       Missing dot at sentence end.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sis] desruisseaux commented on pull request #22: fix(NetCDF): Ignore unrecognized dimensions

Posted by GitBox <gi...@apache.org>.
desruisseaux commented on pull request #22:
URL: https://github.com/apache/sis/pull/22#issuecomment-847879817


   Alternatively, a possible approach could be to accept those features as features without geometry. In this case, the fix could be to modify lines 816- 858 for skipping geometry construction, and make sure that the `FeatureType` has no geometry property.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org