geodetic_converter 0.0.1

  • Readme
  • Changelog
  • Installing
  • new46

geodetic_converter #

Codemagic build status

전 세계적으로 좌표계는 너무 다양합니다. 특히 개발을 위해서는 변환하는 라이브러리가 필수입니다.

구글은 WGS84 좌표계를 사용하고, 기타 한국에서는 TM, KETEC 등의 좌표계를 사용합니다.

이를 극복하기 위해 많은 라이브러리가 있습니다. 대표적으로 JS 에는 Proj4js 가 있습니다.

Flutter 에는 UTM <-> WGS84 라이브러리가 있더군요. 하지만, TM 좌표계가 필요한 분들을 위해 다시 만들었습니다.

소스는 창작보다는 포팅위주의 코드입니다. 기타 버그 및 오류는 일부 수정하였지만, 사용하시는 여러분들의 도움이 필요합니다.

장기적으로 사용자가 많아지면, Proj4js.js 를 포팅하는 방향으로 진행하려 합니다. 감사합니다.

Example #

final geodeticConverter = GeodeticConverter();

// 서울 시청
final seoulCityHallLatLng = GeodeticPoint(x: 37.5666805, y: 126.9784147);
final seoulCityHallPoint = geodeticConverter.wgs84ToTM(x: seoulCityHallLatLng.x, y: seoulCityHallLatLng.y);

// 중구 정동 5-1 (덕수궁내)
final deoksugungPoint = GeodeticPoint(x: 197868, y: 451606);
final deoksugungLatLnt = geodeticConverter.tmToWgs84(x: deoksugungPoint.x, y: deoksugungPoint.y);

// 동작구 사당 4동 300-8
final sadangPoint = GeodeticPoint(x: 197670, y: 443050);
final sadangLatLnt = geodeticConverter.tmToWgs84(point: sadangPoint);

// 검증
final recoverySeoulCityHallLatLng = geodeticConverter.tmToWgs84(x: seoulCityHallPoint.x, y: seoulCityHallPoint.y);
final recoveryDeoksugungPoint = geodeticConverter.wgs84ToTM(x: deoksugungLatLnt.x, y: deoksugungLatLnt.y);
final recoverySadangPoint = geodeticConverter.wgs84ToTM(point: sadangLatLnt);

// 결과
print("${seoulCityHallLatLng.toShortString()} -> ${seoulCityHallPoint.toShortString()} -> ${recoverySeoulCityHallLatLng.toShortString()}");
print("${deoksugungPoint.toShortString()} -> ${deoksugungLatLnt.toShortString()} -> ${recoveryDeoksugungPoint.toShortString()}");
print("${sadangPoint.toShortString()} -> ${sadangLatLnt.toShortString()} -> ${recoverySadangPoint.toShortString()}");

References #

도움이 많이 된 글의 원본을 남깁니다. 원작자 분들에게 감사의 말을 전하고 싶네요.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  geodetic_converter: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:geodetic_converter/geodetic_converter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

5 out of 5 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/geodetic_converter.dart.

Run flutter format to format lib/geodetic_converter.dart.

Format lib/src/geodetic_converter_library.dart.

Run flutter format to format lib/src/geodetic_converter_library.dart.

Format lib/src/geodetic_type.dart.

Run flutter format to format lib/src/geodetic_type.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and geodetic_converter.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test