@dunguel/expo-geo-parser 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,11 +12,36 @@ export type Feature = {
12
12
  geometry: Geometry;
13
13
  properties: Record<string, unknown>;
14
14
  };
15
- export type Geometry = {
16
- type: string;
17
- coordinates?: number[][];
18
- geometries?: Geometry[];
15
+ export type Position = [number, number, ...number[]];
16
+ export type PointGeometry = {
17
+ type: "Point";
18
+ coordinates: Position;
19
19
  };
20
+ export type MultiPointGeometry = {
21
+ type: "MultiPoint";
22
+ coordinates: Position[];
23
+ };
24
+ export type LineStringGeometry = {
25
+ type: "LineString";
26
+ coordinates: Position[];
27
+ };
28
+ export type MultiLineStringGeometry = {
29
+ type: "MultiLineString";
30
+ coordinates: Position[][];
31
+ };
32
+ export type PolygonGeometry = {
33
+ type: "Polygon";
34
+ coordinates: Position[][];
35
+ };
36
+ export type MultiPolygonGeometry = {
37
+ type: "MultiPolygon";
38
+ coordinates: Position[][][];
39
+ };
40
+ export type GeometryCollectionGeometry = {
41
+ type: "GeometryCollection";
42
+ geometries: Geometry[];
43
+ };
44
+ export type Geometry = PointGeometry | MultiPointGeometry | LineStringGeometry | MultiLineStringGeometry | PolygonGeometry | MultiPolygonGeometry | GeometryCollectionGeometry;
20
45
  export type FeatureCollection = {
21
46
  type: "FeatureCollection";
22
47
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGeoParser.types.d.ts","sourceRoot":"","sources":["../src/ExpoGeoParser.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjF,MAAM,MAAM,IAAI,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG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Ae,GACf,oBAAoB,GACpB,0BAA0B,CAAC;AAE/B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGeoParser.types.js","sourceRoot":"","sources":["../src/ExpoGeoParser.types.ts"],"names":[],"mappings":"","sourcesContent":["export type GeoFileType = \"kml\" | \"kmz\" | \"zip\" | \"geojson\" | \"json\" | \"unknown\";\n\nexport type File = {\n uri: string;\n fileName?: string | null;\n extension?: string | null;\n type: GeoFileType;\n uti?: string | null;\n};\n\nexport type Feature = {\n type: \"Feature\";\n id?: string | number;\n geometry: Geometry;\n properties: Record<string, unknown>;\n};\n\nexport type Geometry = {\n type: string;\n coordinates?: number[][];\n geometries?: Geometry[];\n};\n\nexport type FeatureCollection = {\n type: \"FeatureCollection\";\n name?: string;\n description?: string;\n sourceType?: GeoFileType;\n features: Feature[];\n};\n\nexport type ParseFeaturesEvent = {\n features: Feature[];\n isLast: boolean;\n};\n"]}
1
+ {"version":3,"file":"ExpoGeoParser.types.js","sourceRoot":"","sources":["../src/ExpoGeoParser.types.ts"],"names":[],"mappings":"","sourcesContent":["export type GeoFileType = \"kml\" | \"kmz\" | \"zip\" | \"geojson\" | \"json\" | \"unknown\";\n\nexport type File = {\n uri: string;\n fileName?: string | null;\n extension?: string | null;\n type: GeoFileType;\n uti?: string | null;\n};\n\nexport type Feature = {\n type: \"Feature\";\n id?: string | number;\n geometry: Geometry;\n properties: Record<string, unknown>;\n};\n\nexport type Position = [number, number, ...number[]];\n\nexport type PointGeometry = {\n type: \"Point\";\n coordinates: Position;\n};\n\nexport type MultiPointGeometry = {\n type: \"MultiPoint\";\n coordinates: Position[];\n};\n\nexport type LineStringGeometry = {\n type: \"LineString\";\n coordinates: Position[];\n};\n\nexport type MultiLineStringGeometry = {\n type: \"MultiLineString\";\n coordinates: Position[][];\n};\n\nexport type PolygonGeometry = {\n type: \"Polygon\";\n coordinates: Position[][];\n};\n\nexport type MultiPolygonGeometry = {\n type: \"MultiPolygon\";\n coordinates: Position[][][];\n};\n\nexport type GeometryCollectionGeometry = {\n type: \"GeometryCollection\";\n geometries: Geometry[];\n};\n\nexport type Geometry =\n | PointGeometry\n | MultiPointGeometry\n | LineStringGeometry\n | MultiLineStringGeometry\n | PolygonGeometry\n | MultiPolygonGeometry\n | GeometryCollectionGeometry;\n\nexport type FeatureCollection = {\n type: \"FeatureCollection\";\n name?: string;\n description?: string;\n sourceType?: GeoFileType;\n features: Feature[];\n};\n\nexport type ParseFeaturesEvent = {\n features: Feature[];\n isLast: boolean;\n};\n"]}
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
1
  {
2
- "name": "@dunguel/expo-geo-parser",
3
- "version": "0.5.2",
4
- "description": "A high-performance Expo native module for parsing geospatial files like KML, KMZ, and other formats, extracting polygons, markers, and spatial data efficiently on iOS and Android.",
5
- "main": "build/index.js",
6
- "types": "build/index.d.ts",
7
- "scripts": {
8
- "build": "expo-module build",
9
- "clean": "expo-module clean",
10
- "lint": "expo-module lint",
11
- "test": "expo-module test",
12
- "prepare": "expo-module prepare",
13
- "prepublishOnly": "expo-module prepublishOnly",
14
- "expo-module": "expo-module",
15
- "open:ios": "xed example/ios",
16
- "open:android": "open -a \"Android Studio\" example/android"
17
- },
18
- "keywords": [
19
- "react-native",
20
- "expo",
21
- "expo-geo-parser",
22
- "ExpoGeoParser"
23
- ],
24
- "repository": "https://github.com/guilhermedunguel/expo-geo-parser",
25
- "bugs": {
26
- "url": "https://github.com/guilhermedunguel/expo-geo-parser/issues"
27
- },
28
- "author": "Guilherme Dunguel <guilhermedunguel@gmail.com> (https://github.com/guilhermedunguel)",
29
- "license": "MIT",
30
- "homepage": "https://github.com/guilhermedunguel/expo-geo-parser#readme",
31
- "dependencies": {},
32
- "devDependencies": {
33
- "@types/react": "~19.1.1",
34
- "expo-module-scripts": "^55.0.2",
35
- "expo": "^55.0.5",
36
- "react-native": "0.82.1"
37
- },
38
- "peerDependencies": {
39
- "expo": "*",
40
- "react": "*",
41
- "react-native": "*"
42
- }
2
+ "name": "@dunguel/expo-geo-parser",
3
+ "version": "0.6.0",
4
+ "description": "A high-performance Expo native module for parsing geospatial files like KML, KMZ, and other formats, extracting polygons, markers, and spatial data efficiently on iOS and Android.",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "expo-module build",
9
+ "clean": "expo-module clean",
10
+ "lint": "expo-module lint",
11
+ "test": "expo-module test",
12
+ "prepare": "expo-module prepare",
13
+ "prepublishOnly": "expo-module prepublishOnly",
14
+ "expo-module": "expo-module",
15
+ "open:ios": "xed example/ios",
16
+ "open:android": "open -a \"Android Studio\" example/android"
17
+ },
18
+ "keywords": [
19
+ "react-native",
20
+ "expo",
21
+ "expo-geo-parser",
22
+ "ExpoGeoParser"
23
+ ],
24
+ "repository": "https://github.com/guilhermedunguel/expo-geo-parser",
25
+ "bugs": {
26
+ "url": "https://github.com/guilhermedunguel/expo-geo-parser/issues"
27
+ },
28
+ "author": "Guilherme Dunguel <guilhermedunguel@gmail.com> (https://github.com/guilhermedunguel)",
29
+ "license": "MIT",
30
+ "homepage": "https://github.com/guilhermedunguel/expo-geo-parser#readme",
31
+ "dependencies": {},
32
+ "devDependencies": {
33
+ "@types/react": "~19.1.1",
34
+ "expo-module-scripts": "^55.0.2",
35
+ "expo": "^55.0.5",
36
+ "react-native": "0.82.1"
37
+ },
38
+ "peerDependencies": {
39
+ "expo": "*",
40
+ "react": "*",
41
+ "react-native": "*"
42
+ }
43
43
  }
@@ -15,12 +15,52 @@ export type Feature = {
15
15
  properties: Record<string, unknown>;
16
16
  };
17
17
 
18
- export type Geometry = {
19
- type: string;
20
- coordinates?: number[][];
21
- geometries?: Geometry[];
18
+ export type Position = [number, number, ...number[]];
19
+
20
+ export type PointGeometry = {
21
+ type: "Point";
22
+ coordinates: Position;
23
+ };
24
+
25
+ export type MultiPointGeometry = {
26
+ type: "MultiPoint";
27
+ coordinates: Position[];
28
+ };
29
+
30
+ export type LineStringGeometry = {
31
+ type: "LineString";
32
+ coordinates: Position[];
33
+ };
34
+
35
+ export type MultiLineStringGeometry = {
36
+ type: "MultiLineString";
37
+ coordinates: Position[][];
22
38
  };
23
39
 
40
+ export type PolygonGeometry = {
41
+ type: "Polygon";
42
+ coordinates: Position[][];
43
+ };
44
+
45
+ export type MultiPolygonGeometry = {
46
+ type: "MultiPolygon";
47
+ coordinates: Position[][][];
48
+ };
49
+
50
+ export type GeometryCollectionGeometry = {
51
+ type: "GeometryCollection";
52
+ geometries: Geometry[];
53
+ };
54
+
55
+ export type Geometry =
56
+ | PointGeometry
57
+ | MultiPointGeometry
58
+ | LineStringGeometry
59
+ | MultiLineStringGeometry
60
+ | PolygonGeometry
61
+ | MultiPolygonGeometry
62
+ | GeometryCollectionGeometry;
63
+
24
64
  export type FeatureCollection = {
25
65
  type: "FeatureCollection";
26
66
  name?: string;