Closed mj10777 closed 9 years ago
The major coded change have now been made.
AbstractSpatialTable
SpatialiteDatabaseHandler
collectGpkgTables()
and collectVectorTables()
have benn replaced with a collectTables()
Work still needed to be done to insure that
AbstractSpatialTable.parse_vector_key_value()
is completeThe usage of vector_key
and vector_value
The changes have been committed to rasterlite2_styles
branch
The rasterlite2_styles
branch
AbstractSpatialTable
SpatialiteDatabaseHandler
Database connectionMBTiles
, Map
and Mapurl
NULL
vector_value
isValid()
SpatialiteDatabaseHandler
true
will the Table be addedgetStyleNameRaster()
default
: RasterLite2 will return the image without any stylingdefault
or empty)Group
is a
getStyleNameVector()
styleName_Vector_Group
or styleName_Vector
parse_vector_key_value()
vector_key
and vector_value
isValid()
returnsSpatialRasterTable
longLat2Srid()
DaoSpatialite.longLat2Srid(getDatabase(1),lon,lat,getSrid());
getSrid()='Wsg84'
GeopaparazziOverlay
for this to workSpatialiteDatabaseHandler
collectGpkgTables()
and collectVectorTables()
collectTables()
SpatialiteUtilities
Database getMemoryDatabase()
DaoSpatialite.longLat2Srid(getDatabase(1),lon,lat,getSrid());
MBTiles
, Map
and Mapurl
]
Wsg84
Mapurl
]TableTypes
RL2_Vector
RL2_Raster
GeoPackage_features
GeoPackage_features
SPL_Geopackage
min_x,min_y,max_x,max_y
of gpkg_contents
are not set
Spatialite Datalist
SPL_Vectors
RL2_Raster
SPL_Rasterlite.rl2_GetMapImageFromRaster()
SPL_Vectors
New Functions:
rl2_GetMapImageFromVector()
vector_coverage
to work with (yet)vector_coverage
rl2_GetMapImageFromRaster()
1/5
that has yet not be completed
SPL_Rasterlite
rl2_calculate_zoom_levels()
Zoom-Levels
(min,max,default)Pyramids
pyramid_level=0
: being in the original Raster/Image resolutionpyramid_level
tiles are stored
raster_coverage
pyramid_level
a geometry of each tile is stored
srid
set upon creation of the raster_coverage
zoom_default
zoom_min
'WGS 84 / World Mercator' (3395) - UNIT=Meters
HashMap
**zoom_levels`
gdal
fails with 31zoom_max
= zoom_default+(zoom_default-zoom_min)LibraryConstants
SRID_BRANDENBURGER_TOR_187999
Wsg84
parse_vector_key_value()
and rl2_calculate_zoom_levels()
-1
with 187999
General changes
SpatialDataType.RASTERLITE2.getTypeName()
TableTypes.RL2RASTER.getDescription()
Database
driver (where found) has been renamed to:
dbSpatialite
A sample showing
rl2_calculate_zoom_levels[chm_geotiff] srid[32632]
d_width_min[2985.1916391210398] d_width_max[377.9352318990277]
zoom_min[15] zoom_max[19] zoom_default[17]
s_sql_command[
SELECT
(
SELECT
(((ST_MaxX(ST_Transform(geometry,3395))-
ST_MinX(ST_Transform(geometry,3395)))/512)*256)
FROM 'chm_geotiff_tiles'
ORDER BY pyramid_level ASC LIMIT 1
) AS zoom_max,
(
SELECT
(((ST_MaxX(ST_Transform(geometry,3395))-
ST_MinX(ST_Transform(geometry,3395)))/512)*256)
FROM 'chm_geotiff_tiles'
ORDER BY pyramid_level DESC LIMIT 1
) AS zoom_min;
]
rl2_calculate_zoom_levels[1868.rote_rathausturm_panorama] srid[187999]
d_width_min[8181.442336302018] d_width_max[421.2816632759059]
zoom_min[14] zoom_max[20] zoom_default[17]
s_sql_command[
SELECT
(
SELECT
(((ST_MaxX(ST_Transform(SetSRID(geometry,187999),3395))-
ST_MinX(ST_Transform(SetSRID(geometry,187999),3395)))/512)*256)
FROM
'1868.rote_rathausturm_panorama_tiles'
ORDER BY pyramid_level ASC LIMIT 1
) AS zoom_max,
(
SELECT
(((ST_MaxX(ST_Transform(SetSRID(geometry,187999),3395))-
ST_MinX(ST_Transform(SetSRID(geometry,187999),3395)))/512)*256)
FROM
'1868.rote_rathausturm_panorama_tiles'
ORDER BY pyramid_level DESC LIMIT 1
) AS zoom_min;
]
Great great stuff @mj10777 . My return from the Foss4g Europe has been quite cray and I have piles of work to finish. As soon as I have time, I will go through all your comments (only could quickly read through them) and give feedback. Thanks
In the mean time, further code refactoring has been attempted
geopaparazzispatialitelibrary
andgeopaparazzimapsforge
Whereby:
geopaparazzimapsforge
geopaparazzispatialitelibrary
Based on the following criteria:
geopaparazzispatialitelibrary
ANDgeopaparazzimapsforge
using classes in geopaparazzilibrary
But also:
DirectoryBrowserActivity
where one can assume other Applications would find useful
For this, a library directory has been added.
eu.geopaparazzi.spatialite
database
spatial
library
geopaparazzilibrary
The committed changes in branch rasterlite2_styles
All references inside geopaparazzi.app
and geopaparazzimapsforge
eu.geopaparazzi.spatialite.library
For those Classes not used inside geopaparazzilibrary
geopaparazzilibrary
For those Classes used inside geopaparazzilibrary
eu.geopaparazzi.spatialite
geopaparazzilibrary
has been removeddependencies {
// compile project(":geopaparazzilibrary")
compile files('libs/httpmime-4.2.2.jar')
compile files('libs/android-support-v4.jar')
}
And all resulting resources copied into eu.geopaparazzi.spatialite
The next stage, which I will try to complete today, will bee to add the dependency
geopaparazzispatialitelibrary
to geopaparazzilibrary
and
geopaparazzilibrary
geopaparazzispatialitelibrary
--part 2 -- While working on building in the dependency of
geopaparazzispatialitelibrary
into geopaparazzilibrary
(while changing GPLog and GPApplication)
this part will contain a list of directories, where the classes inside do not have further dependencies
geopaparazzilibrary.library
geopaparazzispatialitelibrary
, possible candidates]this part will contain a list of directories, where the classes inside do have have further dependencies
geopaparazzilibrary.library
database.Image
database.IImagesDbHelper
util.CompressionUtilities
forms.FragmentDetail
database.Image
images.ImagesUtilities
sensors.OrientationSensor
(if retained)images.ImagesUtilities
database.Image
database.IImagesDbHelper
database.DefaultHelperClasses
forms.FormUtilities
forms.FormTimePickerFragment
images.ImagesUtilities
database.Image
database.IImagesDbHelper
database.DefaultHelperClasses
forms.FormUtilities
forms.FragmentDetail
markers.MarkersUtilities
images.ImagesUtilities
database.Image
database.IImagesDbHelper
database.DefaultHelperClasses
forms.FormUtilities
forms.FragmentDetail
camera.CameraActivity
forms.FormUtilities
forms.FragmentDetail
forms.FormUtilities
images.ImagesUtilities
database.Image
database.IImagesDbHelper
database.DefaultHelperClasses
forms.FormUtilities
markers.MarkersUtilities
forms.FormUtilities
forms.FormUtilities
forms.FormDatePickerFragment
forms.FormUtilities
forms.FormUtilities
Hi @mj10777 , I am quite worried about this proposal of yours. It is true that Geopaparazzi also wants to act as a library to create location based apps, but it is meant for survey-type apps that base on the geopaparazzi database model, not any gps or spatialite based app. That is the reason some stuff (that you decided to move/copy into spatialite library) has been put into the library project.
I have been able to only browser for about half an hour your changes, but I can state that this proposal will never make it into the master branch. First because it is not the way I designed Geopaprazzi to work. I don't see why gpx and network and other packages should be moved (or even worse duplicated) into the spatialite project. Even the LibraryConstants has been copied and now has a new epsg added, which is really really app specific: SRID_BRANDENBURGER_TOR_187999
Some comments:
After saving the above to a branch spatialite_handler
rasterlite2_styles
has been reverted back to it's original status
Should I upload the spatialite_handler
branch
(where the duplicated have been removed, that what I was working on today)
SRID_BRANDENBURGER_TOR_187999
Closing this, discussion has been going on in the pull request
While attempting to adapt the needed logic to support RasterLite2-Styles support for
I see the need to refactor the code the process between
GeneralQueriesPreparer
andDatabaseCreationAndProperties.checkDatabaseTypeAndValidity
AbstractSpatialTable
these are created in:
SpatialiteDatabaseHandler
collectGpkgTables()
collectVectorTables()
MbtilesDatabaseHandler
getSpatialRasterTables()
CustomTileDatabaseHandler
getTables()
MapDatabaseHandler
getTables()
5 functions that need to be adapted when adding anything new
AbstractSpatialTable
is usedGoals:
AbstractSpatialTable
(and the derived classes)layerTypeDescription
SpatialDataType
andTableTypes
TableTypes
: GPKGRASTER and GPKGVECTOR have been addedvector_value
AbstractSpatialTable
DatabaseHandler
functions doing this will probably not have to be adaptedvector_key,vector_value
The process would then be:
AbstractSpatialTable
int i_rc=parse_vector_key_value(vector_key,vector_value);
SpatialVectorTable
without aSpatialIndex
Inside the
DatabaseHandler
vector_key
layerTypeDescription
SpatialRasterTable
orSpatialVectorTable
Not all classes use
GeneralQueriesPreparer
to createvector_key,vector_value
MapTable
,CustomTileTable
and the special case forMBTiles
One major problem with the
DatabaseHandler
wasSpatialiteDatabaseHandler.collectVectorTables()
forSpatialVectorTable
In all cases, the bounds - if not in WSG84 must be transformed
global
Spatialite-Database connection could be usedHowever for
SpatialVectorTable
DaoSpatialite.collectTableFields(dbJava, table_name);
Since, at the moment,
AbstractSpatialTable
DatabaseHandler
Spatialite-Database connectionparse_vector_key_value
cannot complete this taskSince a major Goal is to simplify the maintenance in one place
DatabaseHandler
is doing extra tasks after the class has been createdSo a policy decision is needed here
AbstractSpatialTable
AbstractSpatialTable
in the constructorI would prefer the first option
longLat2Srid(..)
(at present inSpatialRasterTable
)AbstractSpatialTable
AbstractSpatialTable
At present I built in logic to store the first found Spatialite-Database in
SpatialiteUtilities
with a get/setDatabase()checkDatabaseTypeAndValidity
Missing is still the logic
getDatabase()
is calledThe intention was for this to be used for
longLat2Srid(..)
parse_vector_key_value
but because of the above problem (collectTableFields)
So a policy decision is needed here
AbstractSpatialTable
may share theDatabaseHandler
Spatialite-Database connectionThe result of this will be submitted to the
rasterlite2_styles
branchThe first commit to this branch is based on the present code
The (indended) second commit to this branch
Timeframe:
geopaparazzi
can be adapted to support everything practical