Giter Site home page Giter Site logo

add property data to tile about martin HOT 2 CLOSED

pcace avatar pcace commented on August 18, 2024
add property data to tile

from martin.

Comments (2)

pcace avatar pcace commented on August 18, 2024 1

Hi,

i have found a way by using the db-function functionality by converting it to a text:

CREATE OR REPLACE FUNCTION function_zxy_query(z integer, x integer, y integer, query_params json)
RETURNS bytea AS $$
DECLARE
  mvt bytea;
BEGIN
  SELECT INTO mvt ST_AsMVT(tile, 'function_zxy_query', 4096, 'geom', 'id') FROM (
    SELECT
      ST_AsMVTGeom(
          ST_Transform(ST_CurveToLine("ground_geometry"), 3857),
          ST_TileEnvelope(z, x, y),
          4096, 64, true) AS geom,
    "id",
    attributes::TEXT,
         "cj_metadata_id",
  geometry::TEXT,
    "object_id",
    "type"
    FROM 
      cjdb.city_object
    WHERE 
      "ground_geometry" && ST_Transform(ST_TileEnvelope(z, x, y, margin => 0.015625), 3857)
  ) as tile
  WHERE geom IS NOT NULL;

  RETURN mvt;
END
$$ LANGUAGE plpgsql IMMUTABLE STRICT PARALLEL SAFE;

from martin.

pcace avatar pcace commented on August 18, 2024

Converting a tile to a json using ogre for example shows me, that martin does actually include property data in the file.
BUT only this data wich is of integer or varchar.
is it possible to add jsonb data to the file at all?

Thanks a lot!

from martin.

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.