Comments (4)
The distinct keyword isn't in any of the feature / user dao query shortcut methods. I might be able to add that later. For now you can just run a raw query.
FeatureDao dao = geoPackage.getFeatureDao("table_name");
String column = "column_name";
FeatureResultSet results = dao.getUserDb().rawQuery(
"SELECT DISTINCT " + column + " FROM " + dao.getTableName(), null);
while(results.moveToNext()) {
Object value = results.getValue(0);
//results.getString(0);
//results.getInt(0);
//results.getBlob(0);
//results.getLong(0);
//results.getShort(0);
//results.getDouble(0);
//results.getFloat(0);
System.out.println(value);
}
results.close();
from geopackage-java.
Thanks a lot! In case you're wondering, we're adding Geopackage reader/writer support to hale studio: https://github.com/halestudio/hale/
from geopackage-java.
@thorsten-reitz
Ability added in version 4.0.0. Upon upgrading, the above example can be changed to:
FeatureDao dao = geoPackage.getFeatureDao("table_name");
String column = "column_name";
FeatureResultSet results = dao.query(true, new String[] { column });
while (results.moveToNext()) {
Object value = results.getValue(column);
System.out.println(value);
}
results.close();
from geopackage-java.
@bosborn Great! And thanks for letting us know - @florianesser @stempler something to take into account for the next hale studio milestone.
from geopackage-java.
Related Issues (19)
- Tile DAO get Bounding Box and Tile Grid at a zoom level
- Upgrade geopackage-core version
- Tile Generator and implementations
- What happened to class mil.nga.geopackage.tiles.TileDraw HOT 2
- Adding a NULL time fails even with default HOT 2
- getTileDao thread safety HOT 2
- NSG Profile Support HOT 3
- Example on how to add features to a gpkg missing HOT 2
- Case sensitive geometry column name comparison causes exception HOT 3
- Possible memory leak HOT 5
- Consider supporting the OGC GeoPackage Extension for Tiled Gridded Coverage Data (17-066r1) HOT 2
- Support for Google Maps SDK for Android v3.0 Beta? HOT 1
- FeatureResultSet.moveToFirst() does nothing. HOT 2
- Feature comparison between geopackage-java and geotools implementation? HOT 1
- GeoPackage.getFeatureDao() fails if geopackage uses RTree and file is not writable HOT 2
- SQLite JDBC vulnerability HOT 2
- `org.slf4j:slf4j-nop` SLF4J binding imposed in `mil.nga.geopackage:geopackage`
- Support min and max queries on a column
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geopackage-java.