Skip to content

Commit 38f747d

Browse files
authored
Merge pull request #3 from vojtatom/dev
Updated exports, licensing terms and tests
2 parents 7a96156 + 4f69df0 commit 38f747d

File tree

12 files changed

+69
-28
lines changed

12 files changed

+69
-28
lines changed

LICENCE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
MIT License
2+
3+
Copyright (c) 2023 vojtatom
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
## Third-Party Code
24+
25+
shp.ts uses the following third-party code:
26+
27+
### [ts-shapefile](https://github.com/oyvindi/ts-shapefile/)
28+
29+
> MIT License
30+
>
31+
> Copyright (c) 2020 oyvindi
32+
>
33+
> Permission is hereby granted, free of charge, to any person obtaining a copy
34+
> of this software and associated documentation files (the "Software"), to deal
35+
> in the Software without restriction, including without limitation the rights
36+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37+
> copies of the Software, and to permit persons to whom the Software is
38+
> furnished to do so, subject to the following conditions:
39+
>
40+
> The above copyright notice and this permission notice shall be included in all
41+
> copies or substantial portions of the Software.
42+
>
43+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
46+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
48+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
49+
> SOFTWARE.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "shpts",
33
"private": false,
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"type": "module",
66
"repository": {
77
"type": "git",
@@ -24,7 +24,7 @@
2424
],
2525
"main": "./dist/shpts.umd.js",
2626
"module": "./dist/shpts.js",
27-
"types": "./dist/shpts/shpts.d.ts",
27+
"types": "./dist/shpts.d.ts",
2828
"exports": {
2929
".": {
3030
"import": "./dist/shpts.js",

shpts/shpts.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ import { PointRecord } from './geometry/point';
99
import { MultiPointRecord } from './geometry/multipoint';
1010
import { MultiPatchRecord } from './geometry/multipatch';
1111
import { DbfRecord } from './table/record';
12+
import { DbfFieldDescr, DbfFieldType } from './types/dbfTypes';
13+
import { Coord, CoordType } from './types/coordinate';
1214

1315
export {
1416
DbfReader,
1517
DbfRecord,
1618
ShapeReader,
17-
FeatureCollection as ShapeFeatureCollection,
18-
Feature as ShapeFeature,
19-
FeatureReader as ShapeFeatureReader,
19+
FeatureCollection,
20+
Feature,
21+
FeatureReader,
2022
PolygonRecord,
2123
PolyLineRecord,
2224
PointRecord,
2325
MultiPointRecord,
2426
MultiPatchRecord,
27+
CoordType,
2528
};
29+
30+
export type { DbfFieldType, DbfFieldDescr, Coord };

test/dbf.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { DbfFieldDescr, DbfFieldType } from '@shpts/types/dbfTypes';
1+
import { DbfFieldDescr, DbfFieldType, DbfReader } from '@shpts/shpts';
22
import { expect, test } from 'vitest';
33
import { openFileAsArray } from './utils';
4-
import { DbfReader } from '@shpts/reader/dbfReader';
54

65
function expectField(
76
field: DbfFieldDescr,

test/features.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { expect, test } from 'vitest';
22
import { expectPointsEqual, openFileAsArray } from './utils';
3-
import { FeatureReader } from '@shpts/reader/featureReader';
4-
import { PolyLineRecord } from '@shpts/geometry/polyline';
3+
import { FeatureReader, PolyLineRecord } from '@shpts/shpts';
54

65
test('Read feature OK', async () => {
76
const shp = openFileAsArray('testdata/featureclass.shp');

test/multipatch.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { expect, test } from 'vitest';
2-
import { ShapeReader } from '@shpts/reader/shpReader';
3-
import { expectGeometry, expectPointsEqual, expectRing, openFileAsArray } from './utils';
4-
import { MultiPatchRecord } from '@shpts/geometry/multipatch';
5-
import { CoordType, Coord } from '@shpts/types/coordinate';
2+
import { expectGeometry, expectRing, openFileAsArray } from './utils';
3+
import { ShapeReader, MultiPatchRecord, CoordType } from '@shpts/shpts';
64

75
test('Reading MultiPatchRecord with Z', async () => {
86
const shpBuffer = openFileAsArray('testdata/multipatch.shp');

test/multipoint.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { expect, test } from 'vitest';
2-
import { ShapeReader } from '@shpts/reader/shpReader';
32
import { expectGeometry, expectPointsEqual, openFileAsArray } from './utils';
4-
import { MultiPointRecord } from '@shpts/geometry/multipoint';
5-
import { CoordType } from '@shpts/types/coordinate';
3+
import { ShapeReader, MultiPointRecord, CoordType } from '@shpts/shpts';
64

75
test('Reading PointRecord', async () => {
86
const shpBuffer = openFileAsArray('testdata/multipoint.shp');

test/orientation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import { CoordType, Coord } from '@shpts/types/coordinate';
2+
import { Coord } from '@shpts/types/coordinate';
33
import { assemblePolygonsWithHoles } from '@shpts/utils/orientation';
44

55
test('Testing orientiton for vertical polygons', async () => {

test/point.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { test } from 'vitest';
2-
import { ShapeReader } from '@shpts/reader/shpReader';
32
import { expectGeometry, expectPointsEqual, openFileAsArray } from './utils';
4-
import { PointRecord } from '@shpts/geometry/point';
5-
import { CoordType } from '@shpts/types/coordinate';
3+
import { ShapeReader, PointRecord, CoordType } from '@shpts/shpts';
64

75
test('Reading PointRecord', async () => {
86
const shpBuffer = openFileAsArray('testdata/point.shp');

test/polygon.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { expect, test } from 'vitest';
2-
import { ShapeReader } from '@shpts/reader/shpReader';
32
import { expectGeometry, expectRing, openFileAsArray } from './utils';
4-
import { PolygonRecord } from '@shpts/geometry/polygon';
5-
import { CoordType } from '@shpts/types/coordinate';
3+
import { ShapeReader, PolygonRecord, CoordType } from '@shpts/shpts';
64

75
test('Reading PolygonRecord', async () => {
86
const shpBuffer = openFileAsArray('testdata/polygon.shp');

0 commit comments

Comments
 (0)