Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

FeatureCollection.fromJson() should also accept a 'Reader' parameter

オープン
#1,136 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
api

調査の方向性

services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java と既存の fromJson(String) エントリーポイントを確認してください。示されている Gson アダプター設定を使用して Reader のオーバーロードを追加し、その後、関連するプロジェクトのテストを実行して、既存の String の動作を変更せずに Reader 入力から FeatureCollection が生成されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

GeoJson

Currently a FeatureCollection can not be instantiated from a Reader.
The only function provided requires a String in JSON format as can be seen here.

Such approach is inefficient when reading larger files since the entire file content has to be read and stored in memory before it can be transformed into a FeatureCollection.
If a FeatureCollection could be instantiated from a Reader aswell, only parts of the read file would have to be stored in memory which makes this the more desirable approach in the presented situation.

As the used GSON library already enables the use of a Reader instead of a String, the implementation would be very simple and could look like this:

@Nullable
public static FeatureCollection fromJson(@NonNull Reader reader) { 
  GsonBuilder gson = new GsonBuilder();
  gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create());
  gson.registerTypeAdapterFactory(GeometryAdapterFactory.create());
  return gson.create().fromJson(reader, FeatureCollection.class);
}
主要言語
Java
スター
438
フォーク
117
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mapbox/mapbox-java のほかの issue

mapbox/mapbox-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。