Comments (2)
When creating a Model with FeatureCollection, the final output does not contain a "FeatureCollection" type.
JSONObject statusJSONObject = new JSONObject();
FeatureCollection featureCollection = new FeatureCollection();
for (final Event event :events) {
Feature feature = new Feature();
Point point = new Point( event.getLatitude(),event.getLongitude());
feature.setGeometry(point);
JSONObject jsonObject = new JSONObject();
final Map<String, Object> metadataItems = event.getMetaData();
if (metadataItems != null) {
for (final Entry<String, Object> entry : metadataItems
.entrySet()) {
jsonObject.put(entry.getKey(),
entry.getValue());
}
}
//Add event to properties.
jsonObject.put("email", event.getEmail());
feature.setProperties(jsonObject);
featureCollection.addFeature(feature);
}
JSONObject topNode = featureCollection.toJSON();
it topNode produces:
{
"features": [
{
"type": "Feature",
"properties": {....} }.
why is that? it SHOULD BE:
{
"type": "FeatureCollection",
"features": [
{ ....
is this a bug?? or am i implementing the code incorrectly? Please advise. - Jeryl Cook
from android-geojson.
While I can see the usefulness of such a feature, I believe such conversion is out of scope of this library, and would introduce an unwanted dependency on the Google Maps SDK.
@VanitySoft please file a separate issue if you are still having a problem.
from android-geojson.
Related Issues (11)
- Distribute Via Maven Central HOT 12
- Too much time to parse a GeoJSON including a big property.
- Retrofit integration
- Missing how to get the coordinates? HOT 1
- setOnFeatureClickListener not get proprieties from Multipolygon HOT 1
- Documentation
- Release jar to maven HOT 1
- Points with no altitude HOT 2
- (disregard)
- Was the android sdk level change in 1.0.1 intentional? HOT 3
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 android-geojson.