Hi Peppe,

Interesting changes. Here are some comments, some of which have to be discussed furter with Ede and others,

Le 26/01/2016 07:26, Giuseppe Aruta a écrit :
Hi Ede, Michael, Jukka, Stefan and others
I added some simple boolean ans String methods on
com.vividsolutions.jump.workbench.model.Layer class and
org.openjump.core.rasterimage.RasterImageLayer class
I ask you to give a look and your opinion, these methods should cover many aspects and can be used for future development.
I would like to know if
a) those methods are in the right place
I first thought that the place of such methods should be in layerable or AbstractLayerable, but most of them need Layer specific methods. Something we must pay attention, is that a developper should be able to add new Layer classes (in plugins) without having to modify Layer class (but I think most of your propositions are OK with that)
b) if they are really efficient ( i might loose some aspects)

on Layer class:

1) isTemporaryLayer() Defines all Layer which datasource is null or Layer which are saved into a TEMP folder (those layers are created by Sextante if the Sextante option "save as temporary file" is activated)
I dont't know much about this problem. If this is an information you need to know, I don't mind.

2) isModifiedLayer() == is FeatureCollectionModified
This is a shortcut. In my opinion, it does not improve usability much as it just replace a method name by another. I would not retain it (to make it shorter, you should have writen "return isFeatureCollectionModified()").

3) isVectorLayer() Defines all layer  excluding images (and datastores
Maybe useful. Just wonder why database should not be considered as vectorLayer (or possibly as ImageLayer in future versions).
I think data type and datasource have to be clearly distinguished :
datasource maybe : null (in-memory) temp (for images), file based, datastore, internet datatype maybe : vector (in-memory, file, database, wfs), images (layer, rasterLayer, WMS) Wonder if if could consider datatype as an attribute of layerable and keep datasource at he datasource level...


4) isImageLayer() Defines all image loaded by Layer.class (hope so)
See above

5) isMultipleImagesLayer() Defines a Layer with multiple image
See above

6) isDataStoreLayer() should be defines all Datastore layers. I am not sure about this part of the code
See above

7) isSystemLayer() Defines layer like Fence and Measure, which should be considered as "System" layers
I'm not strictly opposite, but I am not sure what a system layer is exactly. For example, measure layer makes no more sense if you remove the layer it is related to. Is it still a "system" layer. There is a drawback to add such information in

8) isCadLayer() Something I test to work with DXF files, Only layers with COLOR and TEXT attributes
Little helper method. Why not ?

9) isMixedGeometryTypes() Should check if the Layer has mixed geometry types
I think that this method should stay at the FeatureCollection level. It does not make much sense for Image layers. Also I don't know what it is for exactly, but you must know that shapefile can have mixed Polygon/MultiPolygon type.

10) isEmpy() Should defines if the Layer has an empty feature collection
Does not add much, but I don't mind if it makes life easier.
Can be written as a one liner :
return getFeatureCollecctionWrapper().iEmpty()

11) String getGeometryType(). returns the geometry types of the layer
Same remark as 9.

12) String getFilePath() return the path of a Layer, eg. C:/folder/file.shp. If the file is stored into a TEMP folder it returns a warning message (see point 1)
I don't think that DataStoreDataSource.CONNECTION_DESCRIPTOR_KEY should be returned.


for RasterImageLayers:

1) isTemporaryLayer() defines if RasterImageLayer file is stored into a TEMP folder
Wonder if your test with contains is platform independant (it has to be tested).

Michaël

12) String getFilePath() return the path of a Layer, eg. C:/folder/file.tif. If the file is stored into a TEMP folder it returns a warning message (see point 1)

waiting for your opinion

best regards

Peppe


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to