Exception - bad allocation

927 views
Skip to first unread message

Dave Osborne

unread,
Feb 8, 2013, 8:40:37 AM2/8/13
to australian-qg...@googlegroups.com

Hi All

 

I'm a very novice user with a couple of hopefully minor issues:

 

1. "Exception" message  - I've copied an existing folder containing a couple of Projects (and all the associated shape files etc) from my Sony laptop (which has Windows 7) onto my desktop PC (which is still on Windows XP).

I have QGIS Version 1.8.0 Lisboa loaded on both the laptop and the PC.

The original projects open fine in QGIS on the laptop,  but when I try to open them on the PC I get the pop-up message: "Exception - bad allocation".  The project Layers appear to be about 40-50% loaded before the message pops up.

On Googling, I see that message has popped up for others in the past when trying to export from the Composer, but does anyone have any idea what the problem and solution might be in my case?

 

2. Saving vector layer as...  - When attempting to save an edited Layer I get the initial message "Confirm Save As" ..already exists. Do you want to replace it." I then select "Yes" and after trying to save to the selected existing file name I get a "Save Error" message: "export to vector file failed. Error: creation of data source failed (OGR error [.../../../..correct file path].shp is not a directory.)   So I then simply save as a new file name into same directory and the Layer saves OK. Any idea what I'm doing wrong here?

 

Thanks in advance for any clues on the above.

 

Cheers

Dave Osborne

Ramon Andiñach

unread,
Feb 9, 2013, 4:08:14 AM2/9/13
to australian-qg...@googlegroups.com
Hi Dave,

On 08/02/2013, at 21:40 , Dave Osborne wrote:

> Hi All
>
> I'm a very novice user with a couple of hopefully minor issues:
>
> 1. "Exception" message - I've copied an existing folder containing a couple of Projects (and all the associated shape files etc) from my Sony laptop (which has Windows 7) onto my desktop PC (which is still on Windows XP).
> I have QGIS Version 1.8.0 Lisboa loaded on both the laptop and the PC.
> The original projects open fine in QGIS on the laptop, but when I try to open them on the PC I get the pop-up message: "Exception - bad allocation". The project Layers appear to be about 40-50% loaded before the message pops up.
> On Googling, I see that message has popped up for others in the past when trying to export from the Composer, but does anyone have any idea what the problem and solution might be in my case?

I don't know if this is right, but I tend to expand "Bad Allocation" as "Bad Memory Allocation". It's definitely not a missing layer message, that's totally different.
I find it a bit random in what triggers it - although trying to print a composer to image or pdf (not using a pdf driver) with >300dpi and A2 or larger seems to be fairly reliable. This is not your problem though.

I've had the odd problem with workspaces put together on win7 that behaved like yours when moved to another computer. I couldn't work out which layer it was, I took layers out until I had a few left but it just seems that the project gets it into its head that it doesn't want to work. I did tend to find that rebuilding it on the problem computer worked and it kept working when I moved it back.

I'm sure there's a better way.

> 2. Saving vector layer as... - When attempting to save an edited Layer I get the initial message "Confirm Save As" ..already exists. Do you want to replace it." I then select "Yes" and after trying to save to the selected existing file name I get a "Save Error" message: "export to vector file failed. Error: creation of data source failed (OGR error[.../../../..correct file path].shp is not a directory.) So I then simply save as a new file name into same directory and the Layer saves OK. Any idea what I'm doing wrong here?

I'm not clear what you're doing here, but it sounds like you're using Layer-> Save Layer for this?
You're expected to use Layer -> Save edits, or the second icon from the left on the editing tool bar. Failing that, when you turn editing off, QGIS will ask if you want to save things.

Hope that is of some help.

-ramon.

Dave Osborne

unread,
Feb 9, 2013, 7:00:14 AM2/9/13
to australian-qg...@googlegroups.com
Tnx Ramon

1. I had a suspicion I may need to rebuild each Project on the PC, but
unfortuinately that's going to become an extremely tedious process every
time I copy a new Project from laptop to PC, - especially as I work mainly
on the laptop and expect to eventually have about 30 or so individual
projects. :-(

2. Yep, I was using "Save layer as..." and selecting existing layer file
name. But in a recent example, I wasn't doing any map object editing or such
at all. I'd just changed, applied and saved the layer Style and thought I
would not have to be in object editing mode for that layer but could simply
re-save the Layer via "Save as..". But maybe I do have to be in editing mode
before making and saving any changes to a Layer regardless of whether
they're object editing or just a style change?

Dave
--
You received this message because you are subscribed to the Google Groups
"Australian QGIS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to australian-qgis-use...@googlegroups.com.
To post to this group, send an email to
australian-qg...@googlegroups.com.
Visit this group at
http://groups.google.com/group/australian-qgis-user-group?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.



Nathan Woodrow

unread,
Feb 9, 2013, 7:09:57 AM2/9/13
to australian-qg...@googlegroups.com
For 2. are you trying to save over the top of a file that is already open in QGIS? I normally get that error if that I what happens. 

Editing mode is only for editing data, geometry or attribute.  Style changes can be applied in or out of edit mode.

- Nathan 

Dave Osborne

unread,
Feb 9, 2013, 7:34:31 AM2/9/13
to australian-qg...@googlegroups.com

Nathan

 

Your 2nd sentence is what I thought was the case.  

 

Yes, I'm trying to save over open layer file. Surely the file has to be open to apply and save  the style for that layer .   But I've just realised that re-saving the Layer is probably a redundant step as the changed Style is already meant to have been saved while  the Style tab is still open.  - So no additional saving of Layer then needed?

 

Dave

 

From: australian-qg...@googlegroups.com [mailto:australian-qg...@googlegroups.com] On Behalf Of Nathan Woodrow
Sent: Saturday, 9 February 2013 8:10 PM
To: australian-qg...@googlegroups.com
Subject: Re: Exception - bad allocation

 

For 2. are you trying to save over the top of a file that is already open in QGIS? I normally get that error if that I what happens. 

 

Editing mode is only for editing data, geometry or attribute.  Style changes can be applied in or out of edit mode.

 

- Nathan 

--

Nathan Woodrow

unread,
Feb 9, 2013, 7:40:24 AM2/9/13
to australian-qg...@googlegroups.com
Yes styles are stored in the project file and also in a file called a .qml if you have use the Layer Properties -> Save Style button.  In QGIS styles are not stored in the files themselves.  Unlike something like MapInfo which kept the style for the feature inside the tab file.

Styles and data in QGIS are separate layers.

Nathan

Ramon Andiñach

unread,
Feb 9, 2013, 8:40:07 AM2/9/13
to australian-qg...@googlegroups.com

On 09/02/2013, at 20:00 , Dave Osborne wrote:

> Tnx Ramon
>
> 1. I had a suspicion I may need to rebuild each Project on the PC, but
> unfortuinately that's going to become an extremely tedious process every
> time I copy a new Project from laptop to PC, - especially as I work mainly
> on the laptop and expect to eventually have about 30 or so individual
> projects. :-(

They may not all do it...
I've only had some do it, and only sometimes. There's almost certianly something that is being complained about, but my brain isn't working in the right way to see what it is.

Don't give up hope yet.

Ramon Andiñach

unread,
Feb 9, 2013, 8:47:38 AM2/9/13
to australian-qg...@googlegroups.com
Can I expand on Nathan's answer?

There's actually three ways of preserving the style.
1. What Nathan decries below, which creates a .qml file in a specified location.
2. Also mentioned is that the project file records the style in there. (I forget at the moment if it's differences from the default or the whole thing.)
3. "Save as Default", which creates a .qml file in the same directory as your shape file, with the same filename as your shape file.

In your present circumstances, one of those is probably less useful than the others :)

-ramon.

Bill W

unread,
Feb 9, 2013, 8:20:53 PM2/9/13
to australian-qg...@googlegroups.com
Hi Dave,

wr 1. I do a lot of multi computer use of projects, although nowadays I rely on Google Drive and Box to copy between computers. In manual cases or when using sync tools, I have never had your error message. I suspect it something unique to your install of Win7. I suggest you check there first.

I believe the default setting in QGIS project settings is to use "relative references", but it sounds like you should check that to make sure it hasn't been switched to absolute.

I note that my use case for syncing of projects between computers is often with directory structure
- common data
-- raster
-- vector
--- shapefiles
- project 1
- project 2
-- *.qgs project 2 file
-- specific data
--- specific shapefiles

and I find that QGIS 1.8 (and Win7) is very reliable in the opening of layers even though the data is distributed through the tree. Some root levels of the tree can be different, so long as there is some branching point from which all of the structure is mirrored and qgis does not have to look any further down (which is the relative references concept).

ciao
Reply all
Reply to author
Forward
0 new messages