Importing a set of points

gmaths shared this idea 12 years ago
Answered

Hello Markus,


it would be nice if GeoGebra could read a plain text file which contains the coordinates (and possibly names) of a set of points.


e.g. comma delimited:


A,3.5,1.2

B,4.0,2.3

C,4.5,1.8

...


This series of points could be the result of a scientific measurement, where many data are collected automatically.


Having the points directly imported by Geogebra could be used for teaching regression curves: try to fit a straight line or polynomial or any other curve to the experimental data.


Gisbert

Comments (32)

photo
1

It is not too difficult to generate GeoGebra files automatically. Practically they are zip files containing an xml file geogebra.xml and several other files if macros are used.

photo
1

@GD:

Do you really suggest to teach a class of 20 or more pupils aged 14+ to do that just in order to visualize the data of a little experiment with GeoGbra?


I still think my suggestion would produce a very useful feature.

Gisbert

photo
1

This might be fairly easy in JavaScript - I'll have a go tonight if I have time.

photo
1

Should be easy to implement yourself...


Best Regards,

Yves

photo
1

Try the files here:

http://www.borcherds.co.uk/...


The file jkl-parsexml.js is from here:


// jkl-parsexml.js ---- JavaScript Kantan Library for Parsing XML

// Copyright 2005-2007 Kawasaki Yusuke <u-suke@kawa.net>

// http://www.kawa.net/works/j...


[edit: link changed for 2nd time - I'm not doing well tonight :) ]

[edit 2: removed the duff info about not working online]

photo
1

Hi Murkle


The file read_csv.html in refers to a file coords.csv which is not in the folder. :?

Did you mean to include the file or has it been left as an exercise for the user? :D


Zen

photo
1

The file read_csv.html in refers to a file coords.csv which is not in the folder. :?

Did you mean to include the file or has it been left as an exercise for the user? :D


Oops, copied the wrong file. :flushed:


thanks, Zen!

photo
1

Hi Murkle


That is working fine now.

It also works without problem directly (without downloading anything) from

http://www.borcherds.co.uk/...

Thanks for that. I think it has useful possibilities.


Zen

photo
1

That is working fine now.

It also works without problem directly (without downloading anything) from

http://www.borcherds.co.uk/...

Thanks for that. I think it has useful possibilities.


Doh! Of course it does now that I've uploaded the correct CSV file.


Yes, it could easily be adapted to allow a list of commands to be sent to GeoGebra. Who said we couldn't do scripting? :)


Also I meant to say it works better (when using it locally) if you use Firefox as IE throws up a security message.

photo
1

Hi


It seems to me that this method may be useful but have to be a change because I have discovered a bug. Look the algebra window:


http://www.geogebra.org/en/...


Piman

photo
1

What browser is that?


I get a different display bug in the algebra window - far too much vertical space is reserved for point A so you have to scroll right down to see B,C,D. (but they are correct when you get to them :)

photo
1

Hi Murkle


Firefox 2.0.0.6

photo
1

hmm.. seems OK here on Firefox 2.0.0.11 Java 1.6.0_03-b05 Windows XP SP2 (my bug's gone away now too :) )


Anyone else want to try:


http://www.borcherds.co.uk/...


(click on "plot coordinates")

photo
1

Hi All


Still works for me. :D

Current Firefox, etc


Zen

photo
1

Hi Murkle, Zen


Setup exactly equal to the Murkle


Click on the "Plot coordinates" button repeatedly and quickly and see what happens ...


http://www.geogebra.org/en/...


Piman

photo
1

I've tried on two computers today. It works fine on both in Firefox and IE (even when I click repeatedly).


Please can you try double-clicking to open GeoGebra as an application, and then try saving the ggb file if the bug is still there?


thanks!

photo
1

OK for me : Vista + FF 2.0.0.11


Nice !

photo
1

Hi murkle


He returned to happen. But, having saved the file ggb, I opened it and everything was right!


bests

photo
1

Hi murkle


Please, see

http://www.geogebra.org/en/...


Piman

photo
1

Hi Piman


In your example with 4 points, third point shows the bug.

What happens if you have a different number of points?

For example, with 5 points

- is there still a bug?

- is it with the third point, or the fourth point, or what?


Zen

photo
1

Hi Zen


Please, see


http://www.geogebra.org/en/...


bests


Piman

photo
1

Hi Piman


I can see these png's OK.

Please also provide the data file for each one.


Zen

photo
1

I would like to second the OP's original request.

photo
1

Hi SharkD


I would like to second the OP's original request.


What does OP's?


Piman

photo
1

OP = Original Poster/Original Post :D

photo
1

This,

http://www.ulven.biz/java/r...

was made to do something else, but it imports points as well.

Perhaps someone might find it useful...?

photo
1

Hi Ulven

Congratulations for your work.

I am very interested in it.

I know that you will improve it.

Currently, it takes a long time to open the ggb file and if, for example, I get a menu in ggb, also takes a long time.


Bests


piman

photo
1

Hi Ulven,


This,

http://www.ulven.biz/java/r...

was made to do something else, but it imports points as well.

Perhaps someone might find it useful...?


Congratulations from me too: a very nice implementation of what I asked for :D

It would be nice if you could publish it in the GeoGebra-WIKI too.

Gisbert

photo
1

It would be nice if you could publish it in the GeoGebra-WIKI too.

Gisbert


Ok, any suggestions about how and where?


I have put the archive with the neccessary files; reg.zip, in:

http://www.geogebra.org/en/...


(.../files/Norwegian/ulven/reg.zip)


(I would rather not make it runnable from this server, as the security of this server does not allow untrusted programs (like my reg.jar) to be uploaded and run.

photo
1

Hi all,


You might be interested in trying my own solution of this problem:

I use OpenOffice.org Calc macros to produce geogebra (.ggb) files.

Look at http://www.friege.de/geogebra and get the file ggb3_2_punktwolken.ods.


Although it is in german, it should be not too difficult for non german speaking mathematicians to handle it.

But if anybody asks for an english translation, I will find time to do it :)


Gisbert

photo
2

Hi all,


You can

* open the CSV file in Excel

* copy the coordinates of the points

* paste into the ggb spreadheet in columns A and B

* type =(A1,B1) in C1

* autocomplete column C


(I tried to show labels from csv using Text[], but it doesn't seem to be working well in spreadsheets, i've posted a bug report)


update:

They've correted the bug. To see the labels too, now you can

* open the CSV file in Excel

* copy the labels and coordinates of the points

* paste into the ggb spreadheet in columns A to C

* type =(B1,C1) in D1

* type =Text[A1,D1+(0.1,0)] in E1

* autocomplete column D and E

* select items in column D and in the Properties turn off Show Label

* select items in column E and in the Properties turn on Show Object


Bernát

© 2019 International GeoGebra Institute