Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 207
Registered: ‎07-27-2016

Re: Redline - Download as shapefile

Hi Jan,

 

I am not experiencing the same behaviour.

I also tried creating a pss set as epsg 4326.

I seems that in shapefiledownload.js line 10  s.getFeatureDataset([d], function(featureDataset) 

 

the featuredataset contains no geometry:

 

{"featureClasses":[{"id":"RedLine_Compound","name":"RedLine_Compound","geometryFieldName":"geometry","features":[],"fields":[{"isKey":true,"aliasName":"_KEY_","defaultValue":null,"name":"_KEY_","required":false,"dataWindowOrder":null,"type":"System.String","fullTypeName":null,"geometryType":0},{"isKey":false,"aliasName":null,"defaultValue":null,"name":"geometry","required":false,"dataWindowOrder":null,"type":"Intergraph.WebSolutions.Core.WebClient.Platform.Serialization.Stubs.Geometry","fullTypeName":null,"geometryType":4},{"isKey":false,"aliasName":"Comments","defaultValue":null,"name":"Comments","required":false,"dataWindowOrder":null,"type":"System.String","fullTypeName":null,"geometryType":0}]},{"id":"RedLine_Text","name":"RedLine_Text","geometryFieldName":"geometry","features":[],"fields":[{"isKey":true,"aliasName":"_KEY_","defaultValue":null,"name":"_KEY_","required":false,"dataWindowOrder":null,"type":"System.String","fullTypeName":null,"geometryType":0},{"isKey":false,"aliasName":null,"defaultValue":null,"name":"geometry","required":false,"dataWindowOrder":null,"type":"Intergraph.WebSolutions.Core.WebClient.Platform.Serialization.Stubs.Geometry","fullTypeName":null,"geometryType":6},{"isKey":false,"aliasName":"Comment","defaultValue":null,"name":"Comment","required":false,"dataWindowOrder":null,"type":"System.String","fullTypeName":null,"geometryType":0}]}],"idIndex":0}

 

If I atleast can get the json file created as mentioned I can play around with GDAL settings

 

Regards

Jacques

 

Technical Evangelist
Posts: 1,101
Registered: ‎09-11-2015

Re: Redline - Download as shapefile

Try to define a debugger; in the ShapeFileDownload.js code and find out why the geometries are not being included:

(function () {
    // Make sure that FormatConverter is an object
    Type.registerNamespace("FormatConverter");

    function getGeoJSON(legendItem, handler) {
        debugger;
        var d = legendItem.get_definition(),
            s = d.get_mapService(),
            id = d.get_id(),
            scope = this,
            options = { force: {} };
        options.force[id] = true;
        s.getFeatureDataset([d], function(featureDataset) {
            debugger;
            var fc = featureDataset.get_featureClasses()[id],
                json = $geoJSON.getFeatureCollection(fc);
            if (typeof handler === "function")
                handler(json);
        }, scope, options);
    }
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Regular Contributor
Posts: 207
Registered: ‎07-27-2016

Re: Redline - Download as shapefile

Hi Jan,

 

I have found my issue and fixed it. {Force{}} option

I have also added support for EPSG 3857 , and some changes on the drop/download functions.

 

Thanks for all the help!

 

Kind Regards

Jacques

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.