Bug: 199275786

Clone this repo:
  1. 0a3f43d Update OWNERS am: 105049acaf am: 2bb76ad5c9 am: 8c66c7bc7d am: 301ac396ea am: 660889e8be by Neil Fuller · 3 years ago aml_ads_341826060 aml_ads_341826300 aml_ase_341810000 aml_hef_341811030 aml_odp_341812000 aml_rkp_341810000 aml_tz4_332714010 aml_tz5_341510010 android13-d2-release android13-d3-s1-release android13-d4-release android13-d4-s1-release android13-d4-s2-release android13-dev android13-frc-adbd-release android13-frc-art-release android13-frc-cellbroadcast-release android13-frc-conscrypt-release android13-frc-odp-release android13-mainline-adservices-release android13-mainline-appsearch-release android13-mainline-go-adbd-release android13-mainline-go-adservices-release android13-mainline-go-appsearch-release android13-mainline-go-media-swcodec-release android13-mainline-go-mediaprovider-release android13-mainline-go-networking-release android13-mainline-go-neuralnetworks-release android13-mainline-go-odp-release android13-mainline-go-os-statsd-release android13-mainline-go-permission-release android13-mainline-go-resolv-release android13-mainline-go-scheduling-release android13-mainline-go-sdkext-release android13-mainline-go-tethering-release android13-mainline-go-tzdata4-release android13-mainline-go-uwb-release android13-mainline-go-wifi-release android13-mainline-tzdata4-release android13-mainline-uwb-release android13-qpr1-release android13-qpr1-s1-release android13-qpr1-s2-release android13-qpr1-s3-release android13-qpr1-s4-release android13-qpr1-s5-release android13-qpr1-s6-release android13-qpr1-s7-release android13-qpr1-s8-release android13-qpr2-b-s1-release android13-qpr2-release android13-qpr2-s1-release android13-qpr2-s10-release android13-qpr2-s11-release android13-qpr2-s12-release android13-qpr2-s2-release android13-qpr2-s3-release android13-qpr2-s5-release android13-qpr2-s6-release android13-qpr2-s7-release android13-qpr2-s8-release android13-qpr2-s9-release android13-qpr3-c-s1-release android13-qpr3-c-s10-release android13-qpr3-c-s11-release android13-qpr3-c-s12-release android13-qpr3-c-s2-release android13-qpr3-c-s3-release android13-qpr3-c-s4-release android13-qpr3-c-s5-release android13-qpr3-c-s6-release android13-qpr3-c-s7-release android13-qpr3-c-s8-release android13-qpr3-release android13-qpr3-s1-release android13-qpr3-s10-release android13-qpr3-s11-release android13-qpr3-s12-release android13-qpr3-s13-release android13-qpr3-s14-release android13-qpr3-s2-release android13-qpr3-s3-release android13-qpr3-s4-release android13-qpr3-s5-release android13-qpr3-s6-release android13-qpr3-s7-release android13-qpr3-s8-release android13-qpr3-s9-release android14-d1-release android14-d1-s1-release android14-d1-s2-release android14-d1-s3-release android14-d1-s4-release android14-d1-s5-release android14-d1-s6-release android14-d1-s7-release android14-d2-release android14-d2-s1-release android14-d2-s2-release android14-d2-s3-release android14-d2-s4-release android14-d2-s5-release android14-dev android14-gsi android14-mainline-adservices-release android14-mainline-appsearch-release android14-mainline-healthfitness-release android14-mainline-uwb-release android14-platform-release android14-platform-s1-release android14-qpr1-automotiveos-release android14-qpr1-release android14-qpr1-s2-release android14-qpr2-release android14-qpr2-s1-release android14-qpr2-s2-release android14-qpr2-s3-release android14-qpr2-s4-release android14-qpr2-s5-release android14-qpr3-d1-release android14-qpr3-d1-s1-release android14-qpr3-d1-s2-release android14-qpr3-d1-s3-release android14-qpr3-release android14-qpr3-s10-release android14-qpr3-s11-release android14-qpr3-s12-release android14-qpr3-s13-release android14-qpr3-s14-release android14-qpr3-s2-release android14-qpr3-s3-release android14-qpr3-s4-release android14-qpr3-s5-release android14-qpr3-s6-release android14-qpr3-s7-release android14-qpr3-s8-release android14-qpr3-s9-release android14-release android14-s1-release android14-s2-release android14-security-release android14-tests-release android15-release android15-s1-release android15-tests-dev android15-tests-release main main-16k main-16k-with-phones master aml_ads_331131000 aml_ads_331418080 aml_ads_331511020 aml_ads_331611190 aml_ads_331710270 aml_ads_331814200 aml_ads_331920180 aml_ads_340915050 aml_ads_341027030 aml_ads_341131050 aml_ads_341316030 aml_ads_341413000 aml_ads_341517040 aml_ads_341615050 aml_ads_341720000 aml_ads_341826060 aml_ads_341826300 aml_ase_331011020 aml_ase_331112000 aml_ase_331311020 aml_ase_340913000 aml_ase_341113000 aml_ase_341310010 aml_ase_341410000 aml_ase_341510000 aml_ase_341810000 aml_cfg_341510000 aml_go_adb_330913000 aml_go_ads_330913000 aml_go_ads_330915000 aml_go_ads_330915100 aml_go_ase_330913000 aml_go_mpr_330912000 aml_go_net_330913000 aml_go_neu_330912000 aml_go_odp_330912000 aml_go_odp_330913000 aml_go_per_330912000 aml_go_res_330912000 aml_go_sch_330911000 aml_go_sdk_330810000 aml_go_sta_330911000 aml_go_swc_330913000 aml_go_tet_330914010 aml_go_tz4_330912000 aml_go_uwb_330912000 aml_go_wif_330911000 aml_hef_341114030 aml_hef_341311010 aml_hef_341415040 aml_hef_341512030 aml_hef_341613000 aml_hef_341717050 aml_hef_341811030 aml_odp_341610000 aml_odp_341717000 aml_odp_341812000 aml_rkp_341012000 aml_rkp_341015010 aml_rkp_341114000 aml_rkp_341311000 aml_rkp_341510000 aml_rkp_341810000 aml_tz4_331012000 aml_tz4_331012040 aml_tz4_331012050 aml_tz4_331314010 aml_tz4_331314020 aml_tz4_331314030 aml_tz4_331910000 aml_tz4_332714010 aml_tz4_332714050 aml_tz4_332714070 aml_tz5_341510010 aml_tz5_341510050 aml_tz5_341510070 aml_uwb_330810010 aml_uwb_331015040 aml_uwb_331115000 aml_uwb_331310030 aml_uwb_331410010 aml_uwb_331611010 aml_uwb_331613010 aml_uwb_331820070 aml_uwb_331910010 aml_uwb_341011000 aml_uwb_341111010 aml_uwb_341310030 aml_uwb_341310300 aml_uwb_341511050 aml_uwb_341513070 aml_uwb_341710010 android-13.0.0_r16 android-13.0.0_r17 android-13.0.0_r18 android-13.0.0_r19 android-13.0.0_r20 android-13.0.0_r21 android-13.0.0_r22 android-13.0.0_r23 android-13.0.0_r24 android-13.0.0_r27 android-13.0.0_r28 android-13.0.0_r29 android-13.0.0_r30 android-13.0.0_r32 android-13.0.0_r33 android-13.0.0_r34 android-13.0.0_r35 android-13.0.0_r36 android-13.0.0_r37 android-13.0.0_r38 android-13.0.0_r39 android-13.0.0_r40 android-13.0.0_r41 android-13.0.0_r42 android-13.0.0_r43 android-13.0.0_r44 android-13.0.0_r45 android-13.0.0_r46 android-13.0.0_r47 android-13.0.0_r48 android-13.0.0_r49 android-13.0.0_r50 android-13.0.0_r51 android-13.0.0_r52 android-13.0.0_r53 android-13.0.0_r54 android-13.0.0_r55 android-13.0.0_r56 android-13.0.0_r57 android-13.0.0_r58 android-13.0.0_r59 android-13.0.0_r60 android-13.0.0_r61 android-13.0.0_r62 android-13.0.0_r63 android-13.0.0_r64 android-13.0.0_r65 android-13.0.0_r66 android-13.0.0_r67 android-13.0.0_r68 android-13.0.0_r69 android-13.0.0_r70 android-13.0.0_r71 android-13.0.0_r72 android-13.0.0_r73 android-13.0.0_r74 android-13.0.0_r75 android-13.0.0_r76 android-13.0.0_r77 android-13.0.0_r78 android-13.0.0_r79 android-13.0.0_r80 android-13.0.0_r81 android-13.0.0_r82 android-13.0.0_r83 android-14.0.0_r1 android-14.0.0_r10 android-14.0.0_r11 android-14.0.0_r12 android-14.0.0_r13 android-14.0.0_r14 android-14.0.0_r15 android-14.0.0_r16 android-14.0.0_r17 android-14.0.0_r18 android-14.0.0_r19 android-14.0.0_r2 android-14.0.0_r20 android-14.0.0_r21 android-14.0.0_r22 android-14.0.0_r23 android-14.0.0_r24 android-14.0.0_r25 android-14.0.0_r26 android-14.0.0_r27 android-14.0.0_r28 android-14.0.0_r29 android-14.0.0_r3 android-14.0.0_r30 android-14.0.0_r31 android-14.0.0_r32 android-14.0.0_r33 android-14.0.0_r34 android-14.0.0_r35 android-14.0.0_r36 android-14.0.0_r37 android-14.0.0_r38 android-14.0.0_r39 android-14.0.0_r4 android-14.0.0_r40 android-14.0.0_r41 android-14.0.0_r42 android-14.0.0_r43 android-14.0.0_r44 android-14.0.0_r45 android-14.0.0_r5 android-14.0.0_r50 android-14.0.0_r51 android-14.0.0_r52 android-14.0.0_r53 android-14.0.0_r54 android-14.0.0_r55 android-14.0.0_r56 android-14.0.0_r57 android-14.0.0_r58 android-14.0.0_r59 android-14.0.0_r6 android-14.0.0_r60 android-14.0.0_r61 android-14.0.0_r62 android-14.0.0_r63 android-14.0.0_r64 android-14.0.0_r65 android-14.0.0_r66 android-14.0.0_r67 android-14.0.0_r68 android-14.0.0_r69 android-14.0.0_r7 android-14.0.0_r70 android-14.0.0_r71 android-14.0.0_r72 android-14.0.0_r73 android-14.0.0_r74 android-14.0.0_r8 android-14.0.0_r9 android-15.0.0_r1 android-automotiveos-14.0.0_lts2 android-cts-14.0_r1 android-cts-14.0_r2 android-cts-14.0_r3 android-cts-14.0_r4 android-cts-14.0_r5 android-cts-15.0_r1 android-platform-14.0.0_r1 android-platform-14.0.0_r10 android-platform-14.0.0_r11 android-platform-14.0.0_r12 android-platform-14.0.0_r2 android-platform-14.0.0_r3 android-platform-14.0.0_r4 android-platform-14.0.0_r5 android-platform-14.0.0_r6 android-platform-14.0.0_r7 android-platform-14.0.0_r8 android-platform-14.0.0_r9 android-platform-15.0.0_r1 android-security-14.0.0_r1 android-security-14.0.0_r10 android-security-14.0.0_r11 android-security-14.0.0_r12 android-security-14.0.0_r13 android-security-14.0.0_r2 android-security-14.0.0_r3 android-security-14.0.0_r4 android-security-14.0.0_r5 android-security-14.0.0_r6 android-security-14.0.0_r7 android-security-14.0.0_r8 android-security-14.0.0_r9 android-security-15.0.0_r1 android-u-beta-1-gpl android-vts-14.0_r1 android-vts-14.0_r2 android-vts-14.0_r3 android-vts-14.0_r4 android-vts-14.0_r5 android-vts-15.0_r1 frc_340818110 frc_340818170 frc_340819010 frc_340819020 frc_340819030 frc_340819190 frc_340819220 frc_340819280 frc_340821000 frc_350820260 frc_350820420 frc_350820440 frc_350820660 frc_350820860 frc_350820960 frc_350822020 t_frc_adb_330444000 t_frc_art_330443060 t_frc_ase_330444010 t_frc_cbr_330443000 t_frc_con_330443020 t_frc_odp_330442000 t_frc_odp_330442040
  2. 660889e Update OWNERS am: 105049acaf am: 2bb76ad5c9 am: 8c66c7bc7d am: 301ac396ea by Neil Fuller · 3 years ago
  3. 301ac39 Update OWNERS am: 105049acaf am: 2bb76ad5c9 am: 8c66c7bc7d by Neil Fuller · 3 years ago
  4. 8c66c7b Update OWNERS am: 105049acaf am: 2bb76ad5c9 by Neil Fuller · 3 years ago
  5. 2bb76ad Update OWNERS am: 105049acaf by Neil Fuller · 3 years ago

GeoJson POJOs for Jackson

A small package of all GeoJson POJOs (Plain Old Java Objects) for serializing and deserializing of objects via JSON Jackson Parser.

Usage

If you know what kind of object you expect from a GeoJson file you can directly read it like this:

FeatureCollection featureCollection = 
	new ObjectMapper().readValue(inputStream, FeatureCollection.class);

If you want to read any GeoJson file read the value as GeoJsonObject and then test for the contents via instanceOf:

GeoJsonObject object = new ObjectMapper().readValue(inputStream, GeoJsonObject.class);
if (object instanceof Polygon) {
	...
} else if (object instanceof Feature) {
	...
}

and so on.

Or you can use the GeoJsonObjectVisitor to visit the right method:

GeoJsonObject object = new ObjectMapper().readValue(inputStream, GeoJsonObject.class);
object.accept(visitor);

Writing Json is even easier. You just have to create the GeoJson objects and pass them to the Jackson ObjectMapper.

FeatureCollection featureCollection = new FeatureCollection();
featureCollection.add(new Feature());

String json= new ObjectMapper().writeValueAsString(featureCollection);

Maven Central

You can find the library in the Maven Central Repository.

<dependency>
 <groupId>de.grundid.opendatalab</groupId>
 <artifactId>geojson-jackson</artifactId>
 <version>1.8.1</version>
</dependency>