Giter VIP home page Giter VIP logo

Comments (12)

mukil avatar mukil commented on May 27, 2024

Please note that to test-drive the new de-states basemap you manually need to add the following lines to your /config/environment.js (as that file is in our .gitignore):

      {
        id: "german states 2016",
        sources: [
          {
            source: "DE-2016/topojson/vg2500-BKG-NUTS1-combined.json",
          }
        ],
        dictionary: {
          source: "DE-BKG-NUTS1-2016.json",
          identifier: "RS"
        },
        examples: []
      },

And the following line to the "basemap" object in your respective (german, frencht, english) app/locales/de|fr|en/translations.js file:

    "german states 2016": "Germany > States (2016)",

To test-drive the new de-districts basemap branch you manually need to add the following lines to your /config/environment.js and app/locales/de|fr|en/translations.js:

      {
        id: "german districts 2016",
        sources: [
          {
            source: "DE-2016/topojson/vg2500-BKG-NUTS3-combined.json",
          }
        ],
        dictionary: {
          source: "DE-STATIS-NUTS3-2016.json",
          identifier: "RS"
        },
        examples: [
          {
            id: "de_district_inhabitants",
            source: "de-destatis-Inhabitants-nuts3-2016.csv"
          }
        ]
      },
    "german districts 2016": "Germany > Districts (2016)",

from khartis.

apezel avatar apezel commented on May 27, 2024

Hi,

Thank for your help on Khartis ! Can you please make a pull request on master with your new basemap ?

Please add your map configuration into environment.js.tpl. As you said, environment.js isn't versioned.

You'll have to set the suitable projection for Germany too :

source: "DE-2016/topojson/vg2500-BKG-NUTS3-combined.json",
projection "d3.geoMercator" //for example

I switched from D3.js v3 to D3.js v4 so projection name have changed (i.e. : d3.geo.mercator -> d3.geoMercator).

If you don't set the projection, Khartis will assume that it can be manually defined by the user (like the world map). It doesn't make sense for a country only map.

@TomBor may help you with this.

from khartis.

TomBor avatar TomBor commented on May 27, 2024

Hi @mukil ,
To help you I write this page: How to create a basemap for Khartis. But you have already found most of it by yourself.

I have taken a look at your basemap-de-states branch. Everything look fine, except the border layer which need to be rename line (my mistake) but before I think it's better to redone it with the innerlines command line of mapshaper.

For the config part, what is the official projection to be used with Germany ?

from khartis.

mukil avatar mukil commented on May 27, 2024

Hey @TomBor, thanks for the guide and your support!

I wil be able to redo the two basemaps according to the new guide at the end of next week (23/24.3) and then open up a pull request.

For the config part, what is the official projection to be used with Germany ?

I asked a bit around and most of my colleagues prefer to use Lambert conic or Gauss-Krüger (transversale Mercator?) when creating thematic maps about germany.

As i envision it, the projection for rendering country-level maps (as the german basemap i am workin on) should remain interchangeable in Khartis. From my perspective the easyness of projecting the very same geodata through different perspectives is a clear strengths of Khartis. Is there something I can do so this remains (or becomes) possible?

from khartis.

TomBor avatar TomBor commented on May 27, 2024

Thanks @mukil
We already use a Lambert conic for France, and we know that it work well with Khartis. So I suggest to use it again for Germany. But as you can see below, I need two parameters: latitude where the cone is secant (parallels) and position of origin point (rotate).

projection: "d3.geoConicConformal()", transforms:{rotate: [-3, -46.3], parallels: [44, 49]}

About your last remarks, on the contrary of world basemap, with national basemaps we don't offer the multiple projection functionality. And we don't consider to add it, not because it's not possible, but rather because it doesn't change radically the shape of the country. Differences between officials projections at a national level are important for surveyors or experts who need cartography of precision, but for a thematic map with a simplify basemap it is not sufficiently perceptible.

from khartis.

mukil avatar mukil commented on May 27, 2024

Ok, great. For your release I will try to set the lambert conic projection as the default projection for german basemaps in Khartis. Thanks also for sharing your perspective on my remarks :)

I wil be able to redo the two basemaps according to the new guide at the end of next week (23/24.3) ..

And sorry, the correct delivery date for the changes ("the end of next week") is of course the 16/17.3.

Cheers!

from khartis.

mukil avatar mukil commented on May 27, 2024

Hey @TomBor!

Today i was finally able to revise and succesfully integrate the two german basemaps according to your guide. The results are now available with the basemaps-de-mukil branch. Everything seems to be fine now with my basemaps and that version of Khartis.

However, after merging these with the latest changes in the 'master' branch i discoverred a new error. Most probably it is related to the major upgrade of the three d3.js depdendencies. I was yet unable to better understand the issue but it only seems to be thrown with my german basemaps. I would be very happy if someone could have a look and try to identify the issue. It seems to occur only when starting to add more (visualization) layers (step 2) to the two german basemaps i made. The following error is thrown and as a result no further layer can be added to the map;

d3.js:6353 Uncaught Error: invalid format: 0,.2.9999999999999996f

Here is the full stacktrace from Chromium Version 53.0.2785.143 Built on Ubuntu , running on Ubuntu 14.04 (64-bit).

Error: invalid format: 0,.2.9999999999999996f  vendor.js:86087:44
	FormatSpecifier http://localhost:4200/assets/vendor.js:86087:44
	formatSpecifier http://localhost:4200/assets/vendor.js:86081:10
	newFormat http://localhost:4200/assets/vendor.js:86145:17
	bindLayer/< http://localhost:4200/assets/khartis.js:8501:27
	["/home/malted/source/ifl/Khartis/node_modules/d3/build/d3.js"]</</selection_each http://localhost:4200/assets/vendor.js:80967:28
	bindLayer http://localhost:4200/assets/khartis.js:8496:9
	["/home/malted/source/ifl/Khartis/node_modules/d3/build/d3.js"]</</selection_call http://localhost:4200/assets/vendor.js:80931:3
	update http://localhost:4200/assets/khartis.js:8594:18
	_npmD3.default.selection.prototype.enterUpdate http://localhost:4200/assets/khartis.js:33729:7
	exports.default<.drawLegend< http://localhost:4200/assets/khartis.js:8587:7
	applyStr http://localhost:4200/assets/vendor.js:36705:16
	sendEvent http://localhost:4200/assets/vendor.js:30495:11
	notifyObservers http://localhost:4200/assets/vendor.js:34061:7
	propertyDidChange http://localhost:4200/assets/vendor.js:33888:5
	ChainWatchers.prototype.notify http://localhost:4200/assets/vendor.js:28153:9
	chainsDidChange http://localhost:4200/assets/vendor.js:33977:7
	propertyDidChange http://localhost:4200/assets/vendor.js:33887:5
	EachProxy.prototype.contentKeyDidChange http://localhost:4200/assets/vendor.js:50784:7
	applyStr http://localhost:4200/assets/vendor.js:36705:16
	sendEvent http://localhost:4200/assets/vendor.js:30495:11
	notifyObservers http://localhost:4200/assets/vendor.js:34061:7
	propertyDidChange http://localhost:4200/assets/vendor.js:33888:5
	set http://localhost:4200/assets/vendor.js:34326:11
	exports.default<.set http://localhost:4200/assets/vendor.js:48598:14
	notifyDefferedChange http://localhost:4200/assets/khartis.js:4969:13
	GraphLayer<.deferredChange< http://localhost:4200/assets/khartis.js:2901:7
	Backburner.prototype.run http://localhost:4200/assets/vendor.js:14616:18
	Backburner.prototype.debounce/timer< http://localhost:4200/assets/vendor.js:14920:11

And on another occasion:

Uncaught Error: invalid format: 0,[email protected]:6353
FormatSpecifier @ d3.js:6353formatSpecifier @ d3.js:6347newFormat @ d3.js:6411(anonymous function) @ legend.js:160selection_each @ d3.js:1233bindLayer @ legend.js:155selection_call @ d3.js:1197update @ legend.js:253_npmD3.default.selection.enterUpdate @ d3proto.js:17(anonymous function) @ legend.js:248applyStr @ ember.debug.js:22777sendEvent @ ember.debug.js:16567notifyObservers @ ember.debug.js:20133propertyDidChange @ ember.debug.js:19960notify @ ember.debug.js:14225chainsDidChange @ ember.debug.js:20049propertyDidChange @ ember.debug.js:19959enumerableContentDidChange @ ember.debug.js:33753arrayContentDidChange @ ember.debug.js:32449replace @ ember.debug.js:37252insertAt @ ember.debug.js:34138unshiftObject @ ember.debug.js:34273addLayer @ controller.js:295send @ ember.debug.js:31965runRegisteredAction @ ember.debug.js:29021run @ ember.debug.js:688run @ ember.debug.js:20589handler @ ember.debug.js:29015(anonymous function) @ ember.debug.js:43675dispatch @ jquery.js:4435elemData.handle @ jquery.js:4121
ember.debug.js:52502 Attempting transition to graph.layer

After this error appears, adding another layer does not work anymore. New layer elements are just shown after one reloads the page. But after reloading the page the component normally rendering the map (visualization live preview) can not be bootstrapped anymore (=does not appear).

Pulling in the latest changes from master required me to update the following modules:

Missing npm packages: 
Package: @types/d3
  * Specified: ^4.5.0
  * Installed: (not installed)

Package: d3
  * Specified: ^4.7.1
  * Installed: 3.5.17

Package: d3-geo-projection
  * Specified: ^1.2.2
  * Installed: 0.2.16

To double check that this issue is unrelated to the new basemaps i produced I additionally introduced these into the branch with the previous version of Khartis i was working on (from 16 days ago, which is 629c4728233388b0826e83ab0a75b16c33b176cd). There everything seems to work fine. At least no such error is thrown. I hope we can track down this issue somehow. My current observation tells me that it has to do with the basemaps files but of course I could be wrong. Does this error look somehow familiar to someone or do you have any ideas how i could fureher track this down?

Thanks for your help & Kind regards.

from khartis.

apezel avatar apezel commented on May 27, 2024

@mukil Hi, Thanks for your work on Khartis. Can you please try to rebase with the latest version commit ? The problem you're having may not be related to the basemap. I made a change that should resolve it.

from khartis.

mukil avatar mukil commented on May 27, 2024

Hey @apezel, great! Thank for your quick reply! With your latest change the two new basemap work, the error is not thrown anymore. But I accidentialy screwed up the rebase by doing a git pull upstream, which automaticallly triggered a merge.... I just started to read/learn about what git rebase is and will see/try if i can correct that mistake.

Thanks!

from khartis.

apezel avatar apezel commented on May 27, 2024

Hi @mukil. Thank you for your great work on khartis. Rebase isn't required if you're not confortable with it. You can simply pull the latest release and merge it before your pull request. We added two new tooltips that need translation but that's not urgent so if you don't have time to update your code, can you please do your pull request "as is".
Bye.

from khartis.

mukil avatar mukil commented on May 27, 2024

Hey @apezel, ok! I translated the new tooltips and created pull request #9.
Thanks for your kind support!

from khartis.

TomBor avatar TomBor commented on May 27, 2024

@mukil the two basemaps and the german version is online at the official adress!
http://www.sciencespo.fr/cartographie/khartis/en/
Thanks for your contribution.

from khartis.

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.