Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with naming of Poly Line #109

Open
devanshubisht opened this issue Sep 5, 2023 · 1 comment
Open

Issue with naming of Poly Line #109

devanshubisht opened this issue Sep 5, 2023 · 1 comment

Comments

@devanshubisht
Copy link

  [
    geojson.point(gj),
    geojson.line(gj),
    geojson.polygon(gj),
    geojson.multipolygon(gj),
    geojson.multiline(gj),
  ].forEach(function (l) {
    if (l.geometries.length && l.geometries[0].length) {
      write(
        // field definitions
        l.properties,
        // geometry type
        l.type,
        // geometries
        l.geometries,
        function (err, files) {
          var fileName =
            options && options.types && options.types[l.type.toLowerCase()]
              ? options.types[l.type.toLowerCase()]
              : l.type;
          zipTarget.file(fileName + ".shp", files.shp.buffer, { binary: true });
          zipTarget.file(fileName + ".shx", files.shx.buffer, { binary: true });
          zipTarget.file(fileName + ".dbf", files.dbf.buffer, { binary: true });
          zipTarget.file(fileName + ".prj", prj);
        }
      );
    }
  });
  

When a geojson with linestring is being added, the shp type returned is polyline. But there is no option to edit the polyline name under shpwritedownloadoptions/zip optiosn

  export interface DownloadOptions {
    folder?: string;
    filename?: string;
    prj?: string;
    types?: {
      point?: string;
      polygon?: string;
      line?: string;
      multipolygon?: string;
      multiline?: string;
    };
  }
@devanshubisht
Copy link
Author

  export interface DownloadOptions {
    folder?: string;
    filename?: string;
    prj?: string;
    types?: {
      point?: string;
      polygon?: string;
      polyline?: string;
      multipolygon?: string;
      multiline?: string;
    };
  }

Changing this would work, isit possible to add such changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant