tag:blogger.com,1999:blog-5034489627146372337.post7553152200730254369..comments2024-03-21T09:51:03.150+01:00Comments on GeoExamples: Kartograph tutorial: Electoral mapAnonymoushttp://www.blogger.com/profile/12015764612166658132noreply@blogger.comBlogger42125tag:blogger.com,1999:blog-5034489627146372337.post-37354787665585962202022-08-26T18:06:59.874+02:002022-08-26T18:06:59.874+02:00simpmenKpespu Lori Nance NetBalancer
CyberLink You...simpmenKpespu Lori Nance <a href="https://exe2zip.com/category/system/" rel="nofollow">NetBalancer</a><br /><a href="https://exe2zip.com/category/software/" rel="nofollow">CyberLink YouCam</a><br /><a href="https://exe2zip.com/" rel="nofollow">Movavi Video Converter</a><br /> tersdediscseentrannianihttps://exe2zip.com/noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-31268615277356426052022-04-25T02:39:01.469+02:002022-04-25T02:39:01.469+02:00WtiocapYpiza-1988 Beth Johnson https://wakelet.com...WtiocapYpiza-1988 Beth Johnson <a href="https://wakelet.com/wake/7ROLsySDUaFRBKA4DScg2" rel="nofollow">https://wakelet.com/wake/7ROLsySDUaFRBKA4DScg2</a><br /> lamerereWtiocapYpiza-1988https://wakelet.com/wake/wa3cyZFrQy8XfauemYTJ2noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-2770849048502438042014-07-01T08:57:48.054+02:002014-07-01T08:57:48.054+02:00Hi,
Well, actually using kartograph in this case ...Hi,<br /><br />Well, actually using kartograph in this case would be quite difficult. But you can do it. You should create a GeoJSON like this one:<br />[<br />{<br /> "type": "Feature",<br /> "geometry": {<br /> "type": "Point",<br /> "coordinates": [125.6, 10.1]<br /> },<br /> "properties": {<br /> "precipitation": 23.3<br /> }<br />}<br />]<br />With one entry for each point. Once you have this, you can transform it into a shapefile (either with online tools or using the program gdal_transform). Then, you can follow the Kartograph tutorials about drawing points.<br />I think that generating this kind of file shouldn't be very difficult with RAnonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-13827134803698406022014-06-30T23:05:02.896+02:002014-06-30T23:05:02.896+02:00I appreciate that you replied Roger. Thank you so ...I appreciate that you replied Roger. Thank you so much. Ok let's say that I can convert the R data to JSON format. That is not an issue. I've tried to go through most of the tutorials I've found on the net. And the main problem is that I have my data in latlon format, while the rest of these tutorials have more like point-value pairs as the data.<br /><br />For example, my data is a 2-dimensional array where the rows represent latitude and the columns represent longitude and just one type of data ie, rainfall. Can you help me understand how to use Kartograph on this type of data?Gaidin Daishanhttps://www.blogger.com/profile/16031601181114792139noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-83511793673898763162014-06-29T14:31:42.731+02:002014-06-29T14:31:42.731+02:00Hello Marco,
I'm sorry, but I don't know w...Hello Marco,<br />I'm sorry, but I don't know where can be the problem... Maybe you changed the python version or something like that.<br />Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-956768446615617512014-06-29T13:17:06.613+02:002014-06-29T13:17:06.613+02:00Hi,
I have used R just a few times, but:
To use ...Hi,<br /><br />I have used R just a few times, but:<br /><br />To use the KArtograph library, you should have the elections result (or the value you want to show) as a field of the shp file. I have no idea on how to get that.<br /><br />Using D3js, you can have the geometries in one hand (the geoJSON or TopoJSON file) and the results in the other, using a simple json or csv file. Converting the R file to a json one should be quite easy.<br /><br />The same example using D3js can be found here: http://geoexamples.blogspot.com.es/2013/02/d3js-electoral-map.htmlAnonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-78173974091883711852014-06-23T21:15:02.728+02:002014-06-23T21:15:02.728+02:00Hi,
I'm using all this for the first time. I h...Hi,<br />I'm using all this for the first time. I have my data in R (which is convertible to other formats, I guess). I want to do a "chloropleth" map of this data (rainfall over India). Can you please suggest me a tutorial for a beginner??? I am hoping to use rjson if it is possible.Gaidin Daishanhttps://www.blogger.com/profile/16031601181114792139noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-50453056223855121442014-06-13T06:26:49.966+02:002014-06-13T06:26:49.966+02:00Hi Roger,
A few months ago I was able to use Kart...Hi Roger,<br /><br />A few months ago I was able to use Kartograph.py to generate svg maps.<br />Now I can not. Running the test I get this result:<br /><br /><br />mio@mio-desktop:~/kartograph-test$ kartograph world.json -o world.svg<br /><br />> Traceback (most recent call last):<br />> File "/usr/local/bin/kartograph", line 9, in <br />> load_entry_point('kartograph.py==0.6.8', 'console_scripts',<br />'kartograph')()<br />> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337,<br />in load_entry_point<br />> return get_distribution(dist).load_entry_point(group, name)<br />> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279,<br />in load_entry_point<br />> return ep.load()<br />> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989,<br />in load<br />> entry = __import__(self.module_name, globals(),globals(),<br />['__name__'])<br />> File<br />"/usr/local/lib/python2.7/dist-packages/kartograph/__init__.py", line 2,<br />in <br />> from kartograph import Kartograph<br />> File<br />"/usr/local/lib/python2.7/dist-packages/kartograph/kartograph.py", line<br />2, in <br />> from options import parse_options<br />> File "/usr/local/lib/python2.7/dist-packages/kartograph/options.py",<br />line 8, in <br />> import proj<br />> File<br />"/usr/local/lib/python2.7/dist-packages/kartograph/proj/__init__.py",<br />line 21, in <br />> from base import Proj<br />> File<br />"/usr/local/lib/python2.7/dist-packages/kartograph/proj/base.py", line<br />21, in <br />> from shapely.geometry import Polygon, LineString, Point,<br />MultiPolygon, MultiLineString, MultiPoint<br />> File<br />"/usr/lib/python2.7/dist-packages/shapely/geometry/__init__.py", line 4,<br />in <br />> from geo import box, shape, asShape, mapping<br />> File "/usr/lib/python2.7/dist-packages/shapely/geometry/geo.py",<br />line 5, in <br />> from point import Point, asPoint<br />> File "/usr/lib/python2.7/dist-packages/shapely/geometry/point.py",<br />line 7, in <br />> from shapely.geos import lgeos, DimensionError<br />> File "/usr/lib/python2.7/dist-packages/shapely/geos.py", line 100,<br />in <br />> geos_capi_version = geos_c_version = _geos_c_version()<br />> File "/usr/lib/python2.7/dist-packages/shapely/geos.py", line 98, in<br />_geos_c_version<br />> return tuple(int(n) for n in v.split('.'))<br />> File "/usr/lib/python2.7/dist-packages/shapely/geos.py", line 98, in<br /><br />> return tuple(int(n) for n in v.split('.'))<br />> ValueError: invalid literal for int() with base 10: '2 r3921'<br />> <br /><br /><br />Ubuntu 12.10. Python 2.7.<br /><br />Any tip for a possible solution?<br /><br />Regards,<br /><br />Marco Stara<br />ItalyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-44507661843800079232013-11-27T15:11:52.580+01:002013-11-27T15:11:52.580+01:00Hi,
I've never used Kartograph in this way, t...Hi,<br /><br />I've never used Kartograph in this way, to know this information... Anyway, I found that certain projections give a lot of problems with the background, so maybe there is tome bug with the graticule too. I would try changing the projection to test if this is the problem.Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-62380311554484718272013-11-27T11:40:47.662+01:002013-11-27T11:40:47.662+01:00Hey there, i'm using kartograph.py *as a modul...Hey there, i'm using kartograph.py *as a module* to generate an svg form multiple layers (2 .shp, 1 graticule and the background). My problem is that no matter how i order them, the graticule is never visible. Do u have any idea? A hint: since the layer argument uses a dictionary, is not possible for the items in the dict to be ordered in the way you specify. Is there any parameter for ordering?Sairin Lotehttps://www.blogger.com/profile/06475116410036807302noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-17572747053082521872013-09-25T22:56:21.666+02:002013-09-25T22:56:21.666+02:00Try changing the bounds section to something simil...Try changing the bounds section to something similar to<br /><br />"bounds": {<br /> "mode": "bbox",<br /> "data": [-0, 40, 4, 43],<br /> "crop": [-3, 37, 5, 44]<br /> }<br /><br />Crop must cover a bigger region than data so more data than needed is processed to avoid problems at the map edges.Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-54727677263209632332013-09-25T15:56:41.795+02:002013-09-25T15:56:41.795+02:00Yes, the docs doesn't contains much of informa...Yes, the docs doesn't contains much of information. No matter whichever projection is use, the result is same, no full graticule! I don't understand whats going wrong!!! Here is my JSON config file:<br /><br /> {<br /> <br /> "proj": {<br /> "id": "ortho",<br /> "lon0": 0,<br /> "lat0": 0<br /> },<br /><br /> "layers": {<br /> "background": {"special": "sea"},<br /> "graticule": { "special": "graticule", "latitudes": 1, "longitudes": 1, "styles": { "stroke-width": "0.3px" } },<br /> <br /> "Country": {<br /> "src": "data/ne_10m_admin_0_countries.shp",<br /> "filter": { "sov_a3": "CIV" }<br /> },<br /> "OtherCountries": {<br /> "src": "data/ne_10m_admin_0_countries.shp",<br /> "filter": { "sov_a3": ["BFA", "GHA", "GIN", "LBR", "MLI"] }<br /> },<br /> "States": {<br /> "src": "data/ne_10m_admin_1_states_provinces_shp.shp",<br /> "filter": { "admin": "Ivory Coast" }<br /> },<br /> "OtherStates": {<br /> "src": "data/ne_10m_admin_1_states_provinces_shp.shp",<br /> "filter": { "admin": ["Guinea", "Ghana", "Liberia", "Mali", "Burkina Faso" ] }<br /> },<br /> "Roads": {<br /> "src": "data/CIV_roads.shp"<br /> },<br /> "riverlakeslines": {<br /> "src": "data/ne_10m_rivers_lake_centerlines.shp"<br /> },<br /> "lakes": {<br /> "src": "data/ne_10m_lakes.shp"<br /> },<br /> "waterareas": {<br /> "src": "data/CIV_water_areas_dcw.shp"<br /> }<br /> },<br /> "bounds": {<br /> "mode": "bbox",<br /> "data": [-8.712, 4.149, -2.373, 10.898 ]<br /> <br /> }<br />}<br /><br />Here it is, how it looks:<br />http://tinypic.com/r/qwy5hx/5<br />sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-70742859177223761612013-09-25T14:52:43.413+02:002013-09-25T14:52:43.413+02:00Hi, I don't know what's happening in your ...Hi, I don't know what's happening in your case, but the docs (http://kartograph.org/docs/kartograph.py/#graticule) only explain that you can set how many lines you want in the graticule in longitude and latitude.<br />Maybe is a problem with the projection. I had problems with the background for certain projections, it's possible that there is something wrong with this too.Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-53120024651278276142013-09-25T14:48:28.973+02:002013-09-25T14:48:28.973+02:00In my map, the graticule doesn't cover the who...In my map, the graticule doesn't cover the whole map, it only covers up to 80%(just in the centre) and it looks weird..why? how can draw a graticule which covers the entire map?sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-65071178399911774582013-09-20T14:50:34.356+02:002013-09-20T14:50:34.356+02:00Hmmm ok, thanks!Hmmm ok, thanks!sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-44189662002578478082013-09-20T14:48:31.410+02:002013-09-20T14:48:31.410+02:00Well, you don't have to style the svg as in th...Well, you don't have to style the svg as in this post, but as in the other. Actually, it's more or less the same, and you can make it interactive, so it's better.<br />Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-30030612128459818692013-09-20T14:45:38.123+02:002013-09-20T14:45:38.123+02:00Then what is the use of creating styled SVG maps u...Then what is the use of creating styled SVG maps using kartograpgh when we have to do it all over again in kartograph.js ?<br /><br />Thanks for the link!sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-630404813632975532013-09-20T14:40:50.815+02:002013-09-20T14:40:50.815+02:00No, you have to style it in a different way. I hav...No, you have to style it in a different way. I have an other entry at the blog explaining how to do it:<br />http://geoexamples.blogspot.com/2012/11/kartograph-tutorial-ii-going-interactive.html<br />Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-39891885702109023812013-09-20T14:33:48.130+02:002013-09-20T14:33:48.130+02:00Hi Roger,
I have generated a colorful Ivory Coast...Hi Roger,<br /><br />I have generated a colorful Ivory Coast's map but the when i try to load the SVG map with all the layers using kartograpgh.js, only a map without any CSS styling is displayed.. Why so? when I load the same SVG map using object tab of HTML5, map is displayed with all the colors.<br /><br />Doesn't kartograph.js load the SVG maps with the original styling ?sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-18570564835220502612013-09-19T19:15:38.710+02:002013-09-19T19:15:38.710+02:00Thanks for the help, Roger. The file kartograph/pr...Thanks for the help, Roger. The file kartograph/proj/_initi_.py lists the abbreviation for Lambert Conformal Conical as 'lcc'. I modified my .json file accordingly but still no luck. I've submitted an issue on GitHub if you're interested in the fix:<br />https://github.com/kartograph/kartograph.py/issues/90<br /><br />Thanks again!<br /><br />CurtisCurtis Spencernoreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-1692534245260325152013-09-19T15:39:25.452+02:002013-09-19T15:39:25.452+02:00Thanks Roger!
I found out that the problem was wi...Thanks Roger!<br /><br />I found out that the problem was with the projection! Now that i have changed the projection from satellite to sinusoidal, it works!sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-72225247711781285162013-09-19T15:17:50.339+02:002013-09-19T15:17:50.339+02:00Hi Curtis,
Lambert conformal should be included. ...Hi Curtis,<br /><br />Lambert conformal should be included. In proj4 can handle it for sure, but I don't know if kartograph uses the same notation. The tutorial doesn't have docs for the projections, but the code has a file called proj4.py which is supposed to wrap any proj4 projection.<br />I've found this page explaining how to work with it:<br />https://github.com/kartograph/kartograph.py/issues/34<br /><br />Besides, when I tried projections different from the ones at the examples, I found problems for example with the background layer.Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-67391063357819500782013-09-19T15:11:42.744+02:002013-09-19T15:11:42.744+02:00The layer that styles the sea is the background, s...The layer that styles the sea is the background, since your data files contains data from the land, not the sea:<br /><br />#background {<br /> fill: #e8f9fb;<br /> stroke: none;<br />}Anonymoushttps://www.blogger.com/profile/12015764612166658132noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-18566565763864425952013-09-19T15:00:29.523+02:002013-09-19T15:00:29.523+02:00Thanks Roger. That helped!
I have one more proble...Thanks Roger. That helped!<br /><br />I have one more problem. I also want to display the Atlantic ocean(just below ivory coast), for that i am adding the ocean layer(ne_50m_ocean.shp) but when i am trying to apply styles and color, quite shockingly, the styles are being applied to the land area instead of ocean!! I also tried with ne_10m_ocean.shp but the same problem persists. <br /><br />Is there any other way to add a ocean and apply color to it ?<br /><br />I didn't understand how did you added the ocean in your example.<br /><br />Thanks!sai charan singhhttps://www.blogger.com/profile/03914092135310916217noreply@blogger.comtag:blogger.com,1999:blog-5034489627146372337.post-57166918969098714542013-09-18T21:58:46.110+02:002013-09-18T21:58:46.110+02:00Hi Roger,
Thanks for posting this tutorial. It...Hi Roger,<br /><br />Thanks for posting this tutorial. It's been helpful.<br /><br />However, I am having trouble generating a map of France using a .shp file in Lambert Conformal Conic projection. When I run the program, I get an error: ERROR 6: No translation for Lambert_Conformal_Conic to PROJ.4 format is known. My .json config file looks like this:<br /><br />{<br /> "proj": {<br /> "id": "lcc",<br /> "lon0": 3,<br /> "lat0": 46.5,<br /> "lat1": 47.22794391363692,<br /> "lon1": 44.36902841543616<br /> },<br /> "layers": {<br /> "base": {<br /> "src": "COMMUNE.shp",<br /> "join": {<br /> "group-by": {<br /> "commune": "NOM_COMM"<br /> },<br /> "export-ids": false<br /> }<br /> }<br /> }<br />}<br /><br />From what I have read, Kartograph should be able to handle LCC projections. Is this correct? And if so, any idea how to fix the problem?<br /><br />I have installed the most recent version of Kartograph from GitHub today and have successfully generated the world map test project. So I am fairly certain things are configured properly.<br /><br />Thanks!Curtis Spencernoreply@blogger.com