Coder Social home page Coder Social logo

Comments (3)

wangyoucao577 avatar wangyoucao577 commented on May 16, 2024 1

You're right. It works after use mvt.UnmarshalGzipped instead. Previously the .mvt comes from http works because the http.Get will silently uncompress the response if see Content-Encoding: gzip.

The .mvt comes from mapbox server is always gzipped, whatever with Accept-Encoding: gzip or not. I didn't see any explaination from mapbox document about the gzip. It looks like an implementation issue of mapbox's vector tile service.

from orb.

wangyoucao577 avatar wangyoucao577 commented on May 16, 2024

I made a simple command line tool vt2geojson based on this library, which supports load mvt from either file or URL. The strange thing is it's ok to download from URL directly, but it reports this error from file, even from the file in encoding/mvt/testdata.

Please refer to the command line tool from: https://github.com/wangyoucao577/orb/tree/feature/vt2geojson/cmd/vt2geojson

$ cd cmd/vt2geojson
$ go build 
$ 
$ ./vt2geojson -mvt ../../encoding/mvt/testdata/15-8956-12223.mvt -summary
2020/02/03 15:52:51 proto: wrong wireType = 7 for field Layers

from orb.

invisiblefunnel avatar invisiblefunnel commented on May 16, 2024

I believe this failure is due to the data being gzipped. Try to gunzip the file or use mvt.UnmarshalGzipped.

from orb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.